Originally posted by: SystemAdmin
> So does this code need to go anywhere in particular in my source code
> file? (For example, does it need to appear before my math program
> (model) definition? Or will it work anywhere in the source code?
You are correct in using such execute blocks. Given that you need
to apply these CPLEX settings before the model runs, they should be
present anywhere before the maximize and subject to blocks in the .mod
file and are called pre-processing blocks.
More on these pre/post-processing blocks can be found in the following doc link:
http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.ide.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_opl_Language668.html > How can I disable cuts in my source code file? (All cuts, MIR cuts,
> flow cuts, Gomory cuts, etc...)
The simplest way to disable all the cuts that CPLEX would add by default,
would be to set the CutsFactor parameter to 1 or less. More about the parameters
that control cuts can be found in the following doc link:
http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_usrmancplex1842.html One such .mod file could look like the following:
range r = 1..5;
int y[i in r] = i; execute
{ cplex.cutsfactor=0;
} dvar int+ x[r]; minimize sum(i in r) x[i]; subject to
{ forall(i in r) x[i] >= y[i];
}
Hope this helps.
#DecisionOptimization#OPLusingCPLEXOptimizer