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_SOLVERenvironment variable is set, then it is used as the path. - If
params.solverPathis set, its value is returned. - If npm package
@scheduleopt/optalcp-binis installed then it is searched for theoptalcpexecutable. - If npm package
optalcp-bin-previewis installed then the it is searched too. - Finally, if nothing from the above works, the function assumes that
optalcpis in thePATHand returns returns justoptalcp.