This method assumes that state function f is fixed. It returns the start of the ith segment of the state function f.

Namespace: ILOG.CP
Assembly: oplall (in oplall.dll)

Syntax

C#
public int GetSegmentStart(
	IStateFunction f,
	int i
)

Parameters

f
Type: ILOG.Concert..::..IStateFunction
i
Type: System..::..Int32

Remarks

A segment is an interval [start, end) on which the value of f is constant. If the state function is not defined, the value is CP.NoState, elsewhere the value is a non-negative integer. An assertion is violated if state function f is not fixed.

This method can be used to print the content of a state function as illustrated by the following code sample.

Examples

for (int i=0; i < cp.GetNumberOfSegments(f); ++i) Console.WriteLine("[" + cp.GetSegmentStart(f, i) + "," + cp.GetSegmentEnd(f, i) + "):" + cp.GetSegmentValue(f, i) );

For more information on function see the concept State Functions in the C++ Reference Manual.

See Also