Setting CP parameters

How to set a parameter value by adding script statements to the model.

The preferred way to set CP parameters is from the IDE settings editor. However, it is sometimes convenient to set a parameter value by adding script statements to the model.

The IBM ILOG Script syntax to change a CP parameter is:

cp.param.paramName = “paramvalue”

For example:

cp.param.DefaultInferenceLevel = “Low”

or (from the model timetabling.mod):

   var p = cp.param;
   p.logPeriod = 10000;
   p.searchType = "DepthFirst";
   p.timeLimit = 600;

See Constraint programming options in Parameters and settings in OPL for a detailed description of each parameter.

Table 1. IBM ILOG Script CP parameters
Parameter Possible Values Default Value
AllDiffInferenceLevel Default, Low, Basic, Medium, Extended Default
AllMinDistanceInferenceLevel Default, Low, Basic, Medium, Extended Default
BranchLimit   2100000000
ChoicePointLimit   2100000000
ConstraintAggregation On/Off On
CountInferenceLevel Default, Low, Basic, Medium, Extended Default
CumulFunctionInferenceLevel Low, Basic, Medium, Extended Basic
DefaultInferenceLevel Low, Basic, Medium, Extended Basic
ElementInferenceLevel Default, Low, Basic, Medium, Extended Default
FailLimit   2100000000
IntervalSequenceInferenceLevel Low, Basic, Medium, Extended Basic
LogPeriod   1000
LogVerbosity Quiet, Terse, Normal, Verbose Normal
MultiPointNumberOfSearchPoints   30
NoOverlapInferenceLevel Low, Basic, Medium, Extended Basic
OptimalityTolerance   1e-15
PrecedenceInferenceLevel Low, Basic, Medium, Extended Basic
PropagationLog Quiet, Terse, Normal, Verbose Quiet
RandomSeed   0
RelativeOptimalityTolerance   0
RestartFailLimit   100
RestartGrowthFactor   1.05
SearchType DepthFirst, Restart, MultiPoint, Auto Auto
SolutionLimit   2100000000
StateFunctionInferenceLevel Low, Basic, Medium, Extended Basic
TimeLimit   Infinity (number in seconds)
Workers   Auto (as many workers as there are CPUs available)