LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.


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

C++

C#

Java

  • Added LSOperator.Interval, LSOperator.Start, LSOperator.End and LSOperator.Length operators.

  • Added LSModel.interval, LSModel.start, LSModel.end and LSModel.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 and LSSolution.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.