getsol
getsol |
Purpose
This function returns the solution value of a variable or linear expression passed in argument. Note that the variable must be instantiated before calling this function, else it will return its lower bound.
Synopsis
function getsol(x:cpvar) : integer
function getsol(x:cpfloatvar) : real
function getsol(l:cplinexp) : real
Arguments
x
|
a decision variable
|
l
|
a linear expression
|
Return value
The instantiation value of x (or by default its lower bound), respectively the evaluation of the linear expression
Example
The following example shows how to get the solution value of a cpvar
x
val:= getsol(x)
Related topics