Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default ISIC message to (Type I) #135

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

yuxies
Copy link

@yuxies yuxies commented Feb 1, 2024

In MibSModel::printProblemInfo(), change the default Improving Solution Intersection Cut message to Type I cut.

@tkralphs
Copy link
Member

This seems correct to me the way it currently is so I'm going to close this. You can reopen if you disagree.

@tkralphs tkralphs closed this Mar 27, 2024
@yuxies
Copy link
Author

yuxies commented Mar 27, 2024

? But in output info, MibS would print "Type II" even though "Type I" was called. The default intersection cut was set to Type I, not Type II.

@tkralphs
Copy link
Member

I'm lost. If bilevelFreeSetTypeISIC is set to MibSBilevelFreeSetTypeISICWithLLOptSol, that is a Type I cut and it prints out Type I in that case. Otherwise, it prints out Type II. It matches. I don't know what this has to do with the default. It's just printing out what the parameter is set to, whether it's set to that because it's the default or because the user set it manually, it's still the parameter value. I guess I'm missing something, but I still don't get what's going on here.

@yuxies
Copy link
Author

yuxies commented Mar 28, 2024

If user did not set which ISIC, bilevelFreeSetTypeISIC would be MibSBilevelFreeSetTypeISICNotSet. Then it will print out Type II while generating Type I. See this condition check in cut generator.

@tkralphs
Copy link
Member

tkralphs commented Mar 29, 2024

Argh, OK, you had explained this to me before, but the problem is that this is very difficult to see from looking at the code and the fix should make it more transparent. We have a standard mechanism for indicating a parameter's value is not set, which is to set it's value to PARAM_NOT_SET (-1). Here, we are setting the parameter to value -1, but the first issue is that we are using a different symbol for that, which is not very transparent. We should be using PARAM_NOT_SET rather than MibSBilevelFreeSetTypeISICNotSet if we really do want the paramter's value to be "unset."

But on top of that, the reason to allow parameters not to be set in the first place is because we want to know that they are not set manually so that we know it is OK to automatically set them to whatever value seems appropriate, depending on the instance. In this case, I guess that we are always using the same default value no matter what, so there is no reason not to just set that as the default instead of setting it to MibSBilevelFreeSetTypeISICNotSet. Then everything is fine.

So I would get rid of MibSBilevelFreeSetTypeISICNotSet altogether and just set the default value to whatever we want it to be right away.

@tkralphs tkralphs reopened this Mar 29, 2024
@yuxies
Copy link
Author

yuxies commented Mar 29, 2024

Oh I thought we agreed that something went wrong... i should have listed enough details in the front.

just set the default value to whatever we want it to be right away.

Then instead of correcting the condition check, whenever we see MibSBilevelFreeSetTypeISICNotSet but ISIC is on, we would change this to MibSBilevelFreeSetTypeISICWithLLOptSol, i.e. Type I cut, in the adjust parameter function in MibSModel. Do you think it is a better fix?

@tkralphs
Copy link
Member

tkralphs commented Apr 8, 2024

What I mean was just to set the parameter value to a default in MibSParams like many other parameters are already set. The only reason not to just set a default, but rather to leave the parameter's value unset is so that we can detect whether or not the user set the parameter's value manually or not. If there is a default value, we can't know whether the user manually set the parameter's value to that same default (in which case we should leave it as is) or we can change from that default after analyzing the problem structure. You don't need to change any code anywhere else except to eliminate MibSBilevelFreeSetTypeISICNotSet, since the parameter's value will always be set.

@tkralphs tkralphs merged commit f5135aa into coin-or:stable/1.2 Apr 23, 2024
12 checks passed
@tkralphs
Copy link
Member

OK, looks good finally :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants