endEval

OPL numerical expression (scheduling) used to evaluate a piecewise linear function at the end of an interval

Purpose

OPL numerical expression (scheduling) used to evaluate a piecewise linear function at the end of an interval.

context type
Model files (.mod)
dexpr float

Syntax

dexpr float endEval (a,f[,dval]);
 
Where:

pwlFunction f;
dvar interval a;
float dval;

Description

This numerical expression is used to evaluate a piecewise linear function at the end of an interval. Special care must be taken for optional intervals: in this case a float value dval must be specified, to represent the value of the expression when the interval is absent. If this value is omitted, it is considered to be 0.

Example

This example uses a functional expression to model a V-shaped earliness/tardiness cost:


pwlFunction ETCost = piecewise { -1->10; 1 } (10, 0);
dvar interval a[i in 1..n] size d[i];

minimize sum(i in 1..n) endEval(a[i], ETCost);
subject to {
  ...  
}

In this example each activity a[i] specifies its individual preferred end date dd[i]:


dvar interval a[i in 1..n] size d[i]; 
minimize sum(i in 1..n) endEval( a[i], piecewise{ -1->dd[i]; 1 } (dd[i],0) );
subject to {
  ...  
}