This page is for an old version of Hexaly Optimizer.
We recommend that you update your version and read the documentation for the
latest stable release.
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¶
- Added
LSOperator.DISTINCT
operator. - Added
LSModel.distinct()
to create distinct expressions. - Added a new method
LSArray.is_collection()
to test if a value at a given position is a collection.
C++¶
- Added
O_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 methodLSArray::getCollectionValue()
to retrieve the collection value at a given position.
C#¶
- 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 methodLSArray.GetCollectionValue
to retrieve the collection value at a given position.
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 methodLSArray.getCollectionValue
to retrieve the collection value at a given position.