* Supermarket simulation 1 * G. Gordon. Figure 12-4/10-2 POISS FUNCTION RN1,C24 0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69/ 0.6,0.915/0.7,1.2/0.75,1.38/0.8,1.6/0.84,1.83/0.88,2.12/ 0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96,3.2/0.97,3.5/ 0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,7.0/0.9997,8.0 * ISF FUNCTION RN1,D4 0.2,5.0/0.5,10.0/0.9,15.0/1.0,20.0 * SHOPT FUNCTION P$IS,C5 0.0,0.0/5.0,400.0/10.0,900.0/15.0,1500.0/20.0,2250.0 * GENERATE 36,FN$POISS ; Poisson distributed arrival of customers. TRANSFER BOTH,,AWAY ; Check for available baskets. If none, go away. ENTER BSKTS ; Pick up a basket. ASSIGN IS,FN$ISF ; Determine nr. of items. Store in parameter P$IS ADVANCE FN$SHOPT ; Shop. Duration determined by number of items in param IS QUEUE WAIT ; Wait for counter space. ENTER CTRS ; Get counter space DEPART WAIT ; Leave queue ADVANCE V$CKTT ; Check out. LEAVE CTRS ; Free counter space TABULATE TRT ; Tabulate transit time. TABULATE ITMS ; Tabulate number of items. LEAVE BSKTS ; Return basket. TERMINATE 1 ; Leave the supermarket after shopping. AWAY TERMINATE ; Lost customers TRT TABLE M1,500,500,10 ITMS TABLE P$IS,5,5,4 BSKTS STORAGE 50 CTRS STORAGE 5 CKTT VARIABLE P$IS # 10+25 START 50,NP RESET START 1000