stateFunctionValue

OPL function (scheduling) to return the value of a state function.

Purpose

OPL function (scheduling) to return the value of a state function.

context type
Model files (.mod) — postprocessing.
int

Syntax

stateFunctionValue(f, i);

Where:

int i;
stateFunction f;

Description

This function returns the value of state function f at time t in the solution. This function is available when a solution exists.

Example

A basic program using stateFunctionValue with stateFunction:

using CP;

dvar interval it;
stateFunction c;

subject to

{
alwaysEqual(c,it,5);
 startOf(it)==2;
 endOf(it)==4;
}

int v[i in 0..5]=stateFunctionValue(c,i);
execute
{
  writeln(v);
}

assert forall(i in 2..3) v[i]==5;