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.END
andLSOperator.LENGTH
operators.Added
LSModel.interval
,LSModel.start
,LSModel.end
andLSModel.length
to create interval, start, end and length expressions respectively.Added a new class
LSInterval
that holds an interval value. Instances of this class are returned byLSSolution.get_value
orLSExpression.value
.Added a new method
LSExpression.is_interval
to test if an expression is a range or an interval.
C++¶
Added
O_Interval
,O_Start
,O_End
andO_Length
operators.Added
LSModel::intervalVar
,LSModel::start
,LSModel::end
andLSModel::length
to create interval, start, end and length expressions respectively.Added a new class
LSInterval
that holds an interval value.Added new methods
LSSolution::getIntervalValue
,LSExpression::getIntervalValue
,LSExpression::setIntervalValue
andLSSolution::setIntervalValue
to retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression::isInterval
to test if an expression is a range or an interval.
C#¶
Added
LSOperator.Interval
,LSOperator.Start
,LSOperator.End
andLSOperator.Length
operators.Added
LSModel.Interval
,LSModel.Start
,LSModel.End
andLSModel.Length
to create interval, start, end and length expressions respectively.Added a new class
LSInterval
that holds an interval value.Added new methods
LSSolution.GetIntervalValue
,LSExpression.GetIntervalValue
,LSExpression.SetIntervalValue
andLSSolution.SetIntervalValue
to retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression.IsInterval
to test if an expression is a range or an interval.
Java¶
Added
LSOperator.Interval
,LSOperator.Start
,LSOperator.End
andLSOperator.Length
operators.Added
LSModel.interval
,LSModel.start
,LSModel.end
andLSModel.length
to create interval, start, end and length expressions respectively.Added a new class
LSInterval
that holds an interval value.Added new methods
LSSolution.getIntervalValue
,LSExpression.getIntervalValue
,LSExpression.setIntervalValue
andLSSolution.setIntervalValue
to retrieve or set the value of intervals and ranges in the current solution.Added a new method
LSExpression.isInterval
to test if an expression is a range or an interval.