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.5

Release notes

  • A new operator DISTINCT has been added.
  • The SORT operator now accepts a key function as an optional second argument.

Modeling operators

Distinct

Distinct operator accepts one or two operands. With one operand, the operator takes an array and returns the unordered set of distinct values in the array. With two operands, it takes as input a collection or interval and a lambda function, and returns the unordered set of distinct values among all the values returned by the function called on each element of the given collection or interval. This operator can be used to model scheduling problems with a limited number of products types to be produced by a machine.

Sort

The sort operator now accepts two operands. When a lambda fonction is specified as second argument, it is used as a key to sort the input array.

API Changes

Python

C++

C#

Java

  • Added LSOperator.Distinct operator.
  • Added LSModel.distinct to create distinct expressions.
  • Added a new method LSArray.isCollection to test if a value at a given position is a collection, and a new method LSArray.getCollectionValue to retrieve the collection value at a given position.