Originally posted by: SystemAdmin
Hello,
First, a remark, the syntax is not correct. It should for instance be:
stepFunction F = stepwise
{ 0->1; 100->5; 50->6; 0->7; 100
}; dvar interval decoration in 1..7 size 5..5 intensity F;
Steps of a step function are closed on the left and open on the right: [x,y).
The above function has the following values:
[-oo,1) -> 0
[1,5) -> 100
[5,6) -> 50
[6,7) -> 0
[7,+oo) -> 100
Thus indeed it is not what you want.
What you probably want is:
stepFunction F = stepwise
{ 0->0; 100->5; 50->6; 0->7; 100
}; dvar interval decoration in 1..7 size 5..5 intensity F;
Days 0, 1, 2, 3, 4 with utility 100%, then day 5 with 50% and day 6 with 0%.
Note that even so, the model will not be feasible because on time window [1,7) there is not enough room for a size of 5 given the intensity function as the sum of the intensity function over this window is 4.5.
Philippe
#CPOptimizer#DecisionOptimization