Originally posted by: SystemAdmin
You wrote that information on this different
thread :-) I guess the two threads are related. I still could not reproduce your problem here. When I try what you describe everything is fine.
Could you export the problem into a .sav file right before the solve and then post that file here and tell what variables are in the filter? Maybe this would allow me to reproduce the problem.
Could you also do something like this:
// Create filters and store the return values from
// addDiversityFilter() into the filters array.
IloArray<IloCplex::FilterIndex> filters;
...
// Check filter variables.
for (int f = 0; f < filters.getSize(); ++f) {
IloNumVarArray filterVars(env);
cplex.getFilterVars(filters[f], filterVars);
for (int v = 0; v < filterVars.getSize(); ++v) {
if (filterVars[v].getType() != ILOBOOL) {
std::cerr << "Filter variable " << filterVars[v]
<< " not binary!" << std::endl;
::abort();
}
}
}
// Solve model.
try { cplex.solve(); }
catch (IloException& e) { std::cerr << e << std::endl; }
// Check filter variables again.
for (int f = 0; f < filters.getSize(); ++f) {
IloNumVarArray filterVars(env);
cplex.getFilterVars(filters[f], filterVars);
for (int v = 0; v < filterVars.getSize(); ++v) {
if (filterVars[v].getType() != ILOBOOL) {
std::cerr << "Filter variable " << filterVars[v]
<< " not binary!" << std::endl;
::abort();
}
}
}
That is, check the filters right before and after the solve (ignoring the exception that is thrown by solve()).
#CPLEXOptimizers#DecisionOptimization