Function: solve
▸ solve(model
, params?
, log?
): Promise
<SolveResult
>
Solve the provided model and return the result.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
model | Model | undefined | The model to solve. |
params? | Parameters | undefined | The parameters to use for solving. |
log | undefined | WritableStream | process.stdout | The stream to which the solver output (log, trace and warnings) should be redirected. When undefined then the output is ignored. |
Returns
Promise
<SolveResult
>
The result of the solve.
Remarks
This function is asynchronous and returns a promise. Use e.g. await
to wait
for the result. When an error occurs then the returned promise is rejected
and standard Error
object is returned.
To communicate asynchronously with the solver, e.g. process every solution found, use class Solver instead.
For an example of using this function see Model.