PROGRAM
“Thinning and Logical Tests”
DEFINITION
LABELS = {thin0,thin30,thin60,thin90,print1};
filename1:TEXTFILE={NAME=’d:\junk\thins.out’,STATUS=WRITE};”Name Output File”
CONTROL
STOPTIME=400;
LOGIC
ARRIVE {TIME=EXPD(5)};
start: IF(CLOCKTIME<100) THEN GOTO thin0;
IF(CLOCKTIME>100) AND (CLOCKTIME<200) THEN GOTO thin30;
IF CLOCKTIME IN [200,300] THEN GOTO thin60;
IF CLOCKTIME>300 THEN GOTO thin90;
thin0: GOTO print1;
thin30: IF RAND < 0.3 THEN DEPART{ }; “thin out 30% of arrivals”
GOTO print1;
thin60: IF RAND < 0.6 THEN DEPART{ }; “thin out 60% of arrivals”
GOTO print1;
thin90: IF RAND < 0.9 THEN DEPART{ }; “thin out 90% of arrivals”
GOTO print1;
print1: PRINTLN {filename1, CLOCKTIME:15:0};
DEPART{ };
END.