Function: getSolverInfo()
getSolverInfo(
params?:Parameters):Promise<SolverInfo>
Queries the solver for its version and edition.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | Parameters | Optional solver parameters. |
Returns
Promise<SolverInfo>
The solver's version and edition information.
Remarks
Returns the solver's SolverInfo without solving a model. The same information is attached to every SolveResult as SolveResult.solverInfo; this function lets you obtain it before starting a solve — for example to record the solver version at startup, or to check SolverInfo.valuesMasked before relying on solution values.
The solver is located via Parameters.solver or the OPTALCP_SOLVER
environment variable, exactly as when solving.
import * as cp from "@scheduleopt/optalcp";
const info = await cp.getSolverInfo();
console.log(`Solver ${info.solverVersion} (${info.edition})`);
if (info.valuesMasked)
console.warn("Preview edition: solution values are masked.");
See
- SolverInfo for the returned fields.
- SolveResult.solverInfo for the same information after a solve.