Function: calcSolverPath()
calcSolverPath(
params
:Parameters
):string
Compute path to the optalcp
binary.
Parameters
Parameter | Type | Description |
---|---|---|
params | Parameters | Parameters object that may contain the path to the solver. |
Returns
string
Remarks
This function is used to compute the path to optalcp
binary, for example,
when solve is called. Usually, there's no need to call this function
directly. However, it could be used to check the path in case of problems.
The function works as follows:
- If the
OPTALCP_SOLVER
environment variable is set, then it is used as the path. - If
params.solverPath
is set, its value is returned. - If npm package
@scheduleopt/optalcp-bin
is installed then it is searched for theoptalcp
executable. - If npm package
optalcp-bin-preview
is installed then the it is searched too. - Finally, if nothing from the above works, the function assumes that
optalcp
is in thePATH
and returns returns justoptalcp
.