LocalSolver 12.0¶
New modeling operators¶
Interval¶
Interval decision variable. Operator with two integer constant operands that represent the min start and the max end of the decision. Intervals greatly simplify the modeling of scheduling problems.
Start¶
The start of a non-void interval. This operator takes exactly one argument of type interval and returns an integer.
End¶
The end of a non-void interval. This operator takes exactly one argument of type interval and returns an integer.
Length¶
The length of a non-void interval. This operator takes exactly one argument of
type interval and returns an integer. The length of an interval is equivalent to
end(interval) - start(interval). It differs from the count on void intervals
since the length of a void interval is undefined whereas the count of a void
interval is 0.
API Changes¶
Python¶
Added
LSOperator.INTERVAL,LSOperator.START,LSOperator.ENDandLSOperator.LENGTHoperators.Added
LSModel.interval,LSModel.start,LSModel.endandLSModel.lengthto create interval, start, end and length expressions respectively.Added a new class
LSIntervalthat holds an interval value. Instances of this class are returned byLSSolution.get_valueorLSExpression.value.Added a new method
LSExpression.is_intervalto test if an expression is a range or an interval.
C++¶
Added
O_Interval,O_Start,O_EndandO_Lengthoperators.Added
LSModel::intervalVar,LSModel::start,LSModel::endandLSModel::lengthto create interval, start, end and length expressions respectively.Added a new class
LSIntervalthat holds an interval value.Added new methods
LSSolution::getIntervalValue,LSExpression::getIntervalValue,LSExpression::setIntervalValueandLSSolution::setIntervalValueto retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression::isIntervalto test if an expression is a range or an interval.
C#¶
Added
LSOperator.Interval,LSOperator.Start,LSOperator.EndandLSOperator.Lengthoperators.Added
LSModel.Interval,LSModel.Start,LSModel.EndandLSModel.Lengthto create interval, start, end and length expressions respectively.Added a new class
LSIntervalthat holds an interval value.Added new methods
LSSolution.GetIntervalValue,LSExpression.GetIntervalValue,LSExpression.SetIntervalValueandLSSolution.SetIntervalValueto retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression.IsIntervalto test if an expression is a range or an interval.
Java¶
Added
LSOperator.Interval,LSOperator.Start,LSOperator.EndandLSOperator.Lengthoperators.Added
LSModel.interval,LSModel.start,LSModel.endandLSModel.lengthto create interval, start, end and length expressions respectively.Added a new class
LSIntervalthat holds an interval value.Added new methods
LSSolution.getIntervalValue,LSExpression.getIntervalValue,LSExpression.setIntervalValueandLSSolution.setIntervalValueto retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression.isIntervalto test if an expression is a range or an interval.