Page 701 - ExtendSim User Guide

P. 701

```
Analysis 675
Optimization
is greater than or equal to 60. So the solution space is somewhat unlimited. In addition, it would not be valid to just round up a delivery time that is less than 60. If the equation rounded up all the potential delivery times below 60 to exactly 60, as the preceding delivery time equa- tion does, it would cause a severe bias toward getting deliveries every 60 minutes. Instead the equation needs to reject the entire solution set if the delivery time is below 60. This will cause the Optimizer to use a new random delivery time to generate a different set of solutions that will be less biased.
☞ If you use too many global constraints, or constraints that are too restrictive, the equation would unnecessarily reject almost all cases and the Optimizer could take too long to run or might fail to reach an acceptable solution.
The global constrained equation for deliveries of 6000 or more drinks is:
// can't deliver 6000 or more drinks sooner than 60 minutes apart
if (DelTankSize >= 6000 && DeliveryTimes < 60)
Reject = TRUE;
The Optimizer pre-defines “Reject” as a special variable to be used only with global con- straints. The Reject variable, if set to TRUE, will reject that case and cause the block to calcu- late another possible case that could be acceptable. If Reject is not set to TRUE, the current case will be used for the next series of runs.
Enter the constraint equations
In summary, the equations to enter on the Constraints tab of the Optimizer block are:
// round to delivery amounts (e.g. 1k, 2k, 3k, 4k, 6k, 8k)
if (DelTankSize<=4000) DelTankSize = int(DelTankSize/1000.0 +
0.5)*1000.0;
else DelTankSize = int(DelTankSize/2000.0 + 0.5)*2000.0;
// round fill up time to listed delivery times (e.g. 30 minutes)
DeliveryTimes = int(DeliveryTimes/30.0 + 0.5)*30.0;
// can't deliver 6000 or more drinks sooner than 60 minutes apart
if (DelTankSize >= 6000 && DeliveryTimes < 60)
Reject = TRUE;
How To
```