LocalSolver 10.0

Release notes

  • The modeler API has been added to execute LSP programs in Python, C++, C# and Java.
  • The JSON module has been added to the LSP language to interact with JSON files and strings.
  • Black-box optimization offers new features that allow to add analytical constraints and evaluation points to black-box models.
  • The behavior of log writers methods have been changed.
  • Methods for copying an array or collection in a single call have been added in C# and Java to improve the performance of external functions.

Modeler API

The modeler API contains classes for interacting with the LSP virtual machine from your favorite language. This new API allows you to:

  • Load modules from existing LSP files, or create new ones, and execute them.
  • Interact with the variables of your LSP program. You can retrieve, set or create new variables from your favorite language that will be exposed to your LSP code. Numbers and strings are converted to their LSP equivalent, and array-like structures are converted to LSP maps.
  • Expose methods developped in your favorite language as LSP functions.

For more details about the modeler API, please check out the API reference in Python, C++, C# or Java.

JSON Module

The LSP language has now a JSON module. It allows you to read JSON content from a file or a string, and to convert JSON numbers, strings, arrays and objects into their LSP equivalent. It is also possible to write LSP values in a JSON file or a string.

For more details about the JSON module, please check out the documentation on JSON module in the standard library.

Black-box optimization

Black-box models can now be constrained with analytical constraints. It means that all LocalSolver operators can be used in a black-box model as in a classical one, except the operators refering to collection variables. Note that the constraints must not involve the black-box call.

Evaluation points can be added to a black-box model via the black-box context. An evaluation point is a point for which you know the coordinates and the return value of the black-box function. They can be used to warm-start the solver, when the function is particularly expensive to evaluate or if you already have a good estimate of the optimal point.

The return type of the black-box function can now be integer or double, instead of only double.

For more details about how to create a black-box model, please check out the black-box examples on the example tour page.

API Changes


  • Added the JSON module.





  • Added the modeler package.

  • Added the interface LSIntBlackBoxFunction.

  • Added LSModel.createIntBlackBoxFunction() and LSModel.intBlackBoxFunction() to create integer black-box functions.

  • Added the LSBlackBoxEvaluationPoint class.

  • Added the following methods to create and manipulate evaluation points associated to a black-box function:

    • LSBlackBoxContext.createEvaluationPoint()
    • LSBlackBoxContext.getNbEvaluationPoints()
    • LSBlackBoxContext.getEvaluationPoint()
  • Changed the default return value of LSParam.getLogWriter() from null (wich meant standard output) to System.out.

  • Changed the behavior of LSParam.setLogWriter(null): it now disables logging whereas before it restored the standard output.

  • Added the following methods to copy all values of the concerned element to an array:

    • LSArray.copyTo()
    • LSCollection.copyTo()
    • LSBlackBoxArgumentValues.copyTo()
    • LSExternalArgumentValues.copyTo()

    If you need to access all the values of the element, these methods are recommended because they are more performant than a for-loop getting the values one by one.