Hi
you re right and let me give you an example out of the warehouse example in OPL:
int Fixed = 100;
int NbWarehouses = 200;
int NbStores = 600;
assert( NbStores > NbWarehouses );
range Warehouses = 1..NbWarehouses;
range Stores = 1..NbStores;
int Capacity[w in Warehouses] =
NbStores div NbWarehouses +
w % ( NbStores div NbWarehouses );
int SupplyCost[s in Stores][w in Warehouses] =
1 + ( ( s + 10 * w ) % 100 );
dvar int Open[Warehouses] in 0..1;
dvar float Supply[Stores][Warehouses] in 0..1;
dexpr int TotalFixedCost = sum( w in Warehouses ) Fixed * Open[w];
dexpr float TotalSupplyCost = sum( w in Warehouses, s in Stores ) SupplyCost[s][w] * Supply[s][w];
minimize TotalFixedCost + TotalSupplyCost;
subject to {
forall( s in Stores )
ctStoreHasOneWarehouse:
sum( w in Warehouses )
Supply[s][w] == 1;
forall( w in Warehouses )
ctOpen:
sum( s in Stores )
Supply[s][w] <= Open[w] * Capacity[w];
}
execute
{
writeln("Obj=",TotalFixedCost + TotalSupplyCost);
writeln("cplex.status=",cplex.status);
}
main
{
thisOplModel.generate();
cplex.intsollim=2;
cplex.solve();
thisOplModel.postProcess();
}
gives
Obj=16890
cplex.status=104
but if for the main block you write
main
{
thisOplModel.generate();
cplex.intsollim=1;
cplex.solve();
thisOplModel.postProcess();
cplex.solve();
thisOplModel.postProcess();
}
then you ll get
Obj=17300
cplex.status=104
Obj=16890
cplex.status=104
regards
#CPLEXOptimizers#DecisionOptimization