Skip to main content

Function: calcSolverPath()

calcSolverPath(params: Parameters): string

Compute path to the optalcp binary.

Parameters

ParameterTypeDescription
paramsParametersParameters 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 the optalcp 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 the PATH and returns returns just optalcp.