localsolver
public interface LSNativeFunction
LSModel.createNativeFunction(localsolver.LSNativeFunction) or the dedicated shortcut
LSModel.function(localsolver.LSNativeFunction).
LSOperator.Call. The first operand must be your
native function. The other operands must be LSExpressions. Their value will
be made accessible to your native function through the native context.
Note 1: Most of the time your native function will be called
when the solver is in state LSState.Running. Do not attempt to call
any method of the solver (to retrieve statistics, values of LSExpressions or
whatever) in that state or an exception will be thrown. The only accessible
function is LocalSolver.stop().
Note 2: Your functions must be thread-safe. According to the
"nbThreads" parameter, LocalSolver can be multi-threaded. In that case, your
native functions must be thread safe. If you cannot guarantee the
thread-safety of your code, we strongly recommend you to limit the search of
LocalSolver to one thread with LSParam.setNbThreads(int).
| Modifier and Type | Method and Description |
|---|---|
double |
call(LSNativeContext context)
The function to call.
|
double call(LSNativeContext context)
context - Native context containing the arguments of the function.