2' 'ư>HELPA\NhNN:lCONTINUE n((EXIT&%p=lHALTމPldSTEP 1v4߉lg STOP߉X^F%EFSTOP ,,OFFg^w@߉UT߉WOgp߉.Od@g|߉@|ŻOdg@ModelsSample7.gpsLFeCFEOhLhޣhE(((((((((({\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern Courier New;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\tx1200\tx2400\tx4450\plain\f2\fs20 ; GPSS World Sample File - SAMPLE7.GPS \par ********************************************************************** \par * * \par * Automobile Arrival Simulation * \par * * \par * For simplicity, this model only deals with one-way traffic * \par * in North-South and East-West directions. * \par ********************************************************************** \par GENERATE 20,10 ;Create next automobile. \par QUEUE Eastwest \par TEST E X$EWlight,F$Intersection ;Block until green, and \par * the intersection is free \par SEIZE Intersection \par DEPART Eastwest ;End queue time. \par ADVANCE 10 ;Cross the intersection. \par RELEASE Intersection \par TERMINATE 1 ;Auto leaves intersection. \par * \par GENERATE 30,10 ;Create next automobile. \par QUEUE Northsouth \par TEST E X$NSlight,F$Intersection ;Block until green and \par * the intersection is free \par SEIZE Intersection \par DEPART Northsouth ;End queue time. \par ADVANCE 10 ;Cross the intersection. \par RELEASE Intersection \par TERMINATE 1 ;Auto leaves intersection. \par ********************************************************************** \par * * \par * Traffic Light Simulation * \par * * \par ********************************************************************** \par GENERATE ,,,1 \par Begin1 SAVEVALUE NSlight,Red ;North-South light turns red \par SAVEVALUE EWlight,Green ;East-West light turns green \par ADVANCE Greentime ;Light is green \par SAVEVALUE NSlight,Green ;North-South light turns green \par SAVEVALUE EWlight,Red ;East-West light turns red \par ADVANCE Redtime ;Light is red \par TRANSFER ,Begin1 \par Greentime EQU 200 \par * When the light is Green (value 0) and the intersection is not busy \par * (the State Variable(SNA) F$Intersection evaluates as 0), a car may \par * pass into the intersection. These conditions are tested at the TEST \par * block. When the light is red (value 100) or the intersection is busy \par * (SNA F$Intersection returns the value 1), the condition at the TEST \par * block will not be met and the car will not proceed. \par Green EQU 0 \par Red EQU 100 \par Redtime EQU 300 \par * \par * Do START 4000 EW Congestion builds. Try Greentime EQU 1000. Fine \par * but NS congestion builds. Greentime EQU 400 works for both. \par \par \par }