Page 705 - ExtendSim User Guide

P. 705

```
NumSlots = NumActivities+3; // change it
Sometimes you might need the IF-ELSE form:
if (Var2 >= 3)
Var2 = Var3-Var4;
else// var2 was less than 3
Var2 = Var5/2;
In some cases you just need to modify the value of a variable. For example, if you need to con- strain its values to multiples of 0.5 (i.e. 1.0, 1.5, 2.0). You do this by multiplying the variable by 2, adding 0.5 before the Int() function truncates it so that it rounds it to the nearest integer, and then dividing by 2.0, forcing the result to floating point values that are granular to 0.5:
Var2 = Int(var2*2.0+0.5)/2.0; // 0.5 Granularity
In any case the newly calculated Var2 value will replace the old Var2 value.
Global constraints
Global constraints are useful to reject an entire case if any or all of the decision variables don’t meet a specific criteria. Global constraints are entered as equations, usually with IF statements, to assign the value TRUE to the variable REJECT if the variables are not within the constraint. They are entered like this example:
if (Var4+Var5 > 7)
Reject = TRUE; // only reject if the sum is too large
☞ Reject is a special optimization variable for use with global constraints. If set to TRUE, it will reject that case and cause the block to calculate 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.
Sometimes you might need a more complex form:
if (Var4+Var5 > 7 || Var4 < 2) // the || means OR, && means AND
Reject = TRUE;
In any case, any global constraint will abort that particular case and the Optimizer block will keep attempting to create cases until the global constraint doesn’t set REJECT to TRUE. It will try to create 500 new cases before it gives up and prompts the user with an error message. If this occurs, the global constraint is probably faulty.
Interpreting results
The Results tab shows the entire population of solutions, sorted with the best one on top (row 0). As the optimization progresses, new and better solutions will replace inferior solutions in the population table.
If the optimization terminates for any reason, either via normal convergence or running for the maximum number of generations, the best solution set found so far is automatically placed in the model.
Stat::Fit (Windows only)
In simulation models, it is often useful to characterize a random input (for example, inter- arrival times and demand rates) using a probability distribution. Typically, this involves obtain- ing historical data that documents the system’s behavior, then analyzing the data to determine
Analysis 679
Stat::Fit (Windows only)
How To
```