MODULE Queue3; (* M/M/1 queue, PROCESS VIEW *) IMPORT SIM, EVENT, PROCS, RES; FROM RES IMPORT Resource, Request, Release, Report; FROM PROCS IMPORT Delay, Terminate; FROM RAND1 IMPORT Expon; VAR Dock : Resource; Customer : PROCS.ProcessType; EndSim : EVENT.EventType; PROCEDURE ProcCustomer; BEGIN PROCS.Schedule (Customer, Expon (10.0, 1), NIL); Request (1, Dock); Delay (Expon (9.0, 2)); Release (1, Dock); Terminate; END ProcCustomer; PROCEDURE ProcEndSim; BEGIN Report (Dock); SIM.Stop; END ProcEndSim; BEGIN EVENT.Create (EndSim, ProcEndSim, "End of the simulation"); PROCS.Create (Customer, ProcCustomer, 2048, "One customer"); RES.Create (Dock, RES.Fifo, 1, 'My favorite dock'); RES.CollectStat (Dock); SIM.Init; EVENT.Schedule (EndSim, 1000.0, NIL); (* Horizon: 1000 hours. *) PROCS.Schedule (Customer, Expon (10.0, 1), NIL); SIM.Start; END Queue3.