More types

This section describes additional types.

Type stepFunction

A step function is a function that remains constant within each of a series of adjacent intervals but changes in value from one interval to the next. stepFunction is used to express intensity of a work during intervalVar, or to forbid intervalVar to start in, stop in, or extend into certain intervals using constraints forbidStart, forbidEnd and forbidExtent.

Step functions are created using the function stepFunction.

Type segmentedFunction

A segmented function is a piecewise linear function. Segmented functions can be created using a function with the same name: segmentedFunction. The value of a segmented function can be evaluated using functions startEval, endEval, lengthEval and sizeEval.

Type transitionMatrix

A transition matrix is a square matrix of integers that represent minimum delays necessary to make transitions between states, locations and so on. It can be used in

  • stateFunction to enforce minimum delays between different states
  • noOverlap to enforce minimum delays between no-overlapping interval variables.

A transition matrix can be created by the function with the same name: transitionMatrix.

Type tupleSet

A tuple set is essentially a matrix of integers, but not necessarily square. Boolean expressions allowedAssignments and forbiddenAssignments use tupleSet to express allowed/forbidden combinations of values for a collection of variables. Each allowed/forbidden combination is called a tuple and it is represented by a row in the tupleSet matrix. The order of rows in the matrix is not important, therefore the word "set".

Tuple sets are created in the same way as arrays:


allowedCombinations = tupleSet[
  [1, 3, 4],
  [1, 3, 5],
  [1, 2, 7],
  [2, 2, 6],
  [2, 3, 7]
];

A trailing comma after a non-empty list of tuples is allowed. An empty tuple set is also allowed. Note that all tuples must have the same arity, i.e. all the rows of the matrix must have the same length.