Queuing system, multiple experiments
const double ENDTime = 2000;
Facility Box("Box");
Histogram Table("Table",0,25,20);
class Zakaznik : public Process {
double Arrival;
void Behavior() {
Seize(Box);
Wait(10);
Release(Box);
}
public:
};
class Generator : public Event {
double dt;
void Behavior() {
new Zakaznik;
}
public:
Generator(
double d) : dt(d) {
Activate(); }
};
if(
Time>0)
Print(
" %g", Table.stat.MeanValue());
}
Print(
"# multiexp --- multiple experiments (T=%g) \n", ENDTime);
for(int i=1; i<=20; i++) {
Print(
"# Experiment#%d \n", i);
Box.Clear();
Table.Clear();
double interval = i;
new Generator(interval);
Print(
" %g\n", Table.stat.MeanValue());
}
}