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.

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.

LSCallback Interface

class

LSCallback interface.

Implementing the LSCallback interface enables users to call functions to react to specific events or to call a function regularly during the search. It can be used for example to control when to stop the search or to display some specific information during the search.

Note 1: When a callback is called, the solver is paused. In that state, you can call all the methods marked as “allowed in state S_Paused”. Calling any other method will throw an error.

Note 2: LocalSolver does not manage memory of objects created outside of its environment. Thus, you have to explicitly remove and delete your LSCallback at the end of the search.

Since:4.0

Summary

Functions
callback The function that will be called during LocalSolver search.
~LSCallback Default virtual destructor.

Functions

virtual void localsolver::LSCallback::callback(LocalSolver &solver, LSCallbackType type)
= 0

The function that will be called during LocalSolver search.

Parameters:
  • solver - The solver calling the function.
  • type - The type of event that triggered the call.

virtual localsolver::LSCallback::~LSCallback()

Default virtual destructor.