The problem is to compute the queues and waiting times of people that are to be served one by one in a window. They enter the system at random and the serving times are also random. After being served they left the system. The GLIDER program may be as follows:
Simulation of a simple serving system. Patrons enter the system to be served at a window. The times between arrivals are taken at random from an exponential distribution with mean Tba. The patrons are served or form a queue in front of the window. The serving time is taken from a gaussian distribution with mean: MeanWait and standard deviation: StaDev. Once they are served they go to Exit to leave the system. The simulation is to go until time 1000. Statistics of nodes are required. For clarity reserved words are written in uppercase letters. NETWORK Entry (I) Window :: IT := EXPO(Tba); Window (R) Exit :: STAY := GAUSS(MeanWait, StaDev); Exit :: INIT TSIM := 1000; ACT(Entry, 0); Tba := 4; MeanWait := 3.8; StaDev := 0.8; DECL VAR Tba, MeanWait, StaDev: REAL; STATISTICS Entry, Window, Exit; END.The program has four sections divided by three separators:
NETWORK, INIT and DECL.
{ }
or (* *)
may however be included at any place in which a
blank is allowed).
This section contains the nodes of the program. The name
of each node must be at the beginning of the line (except blanks
and comments). The heading of a node also
includes the type of the node (a letter between ()
)
and the successors nodes. The characters :: terminate the
heading, after them the code may follows. The code is written
in free format from column 1 to 75. The word INIT at the beginning
of a line indicates the end of the NETWORK section.
See Chapters 4 and 5 for more details.
The structured instructions of GLIDER (like
STAY := <expression)
are described in Chapter 6, the procedures (like ACT
)
in Chapter 7, the functions (like EXPO
or
GAUSS
), in Chapter 8.
For each user programmed node, the compiler will generate a
procedure that contains the user code
and system provided code
to perform the other operations of the node implied by its type.
This procedure is executed when the node is activated.
This section must contain at least an ACT procedure
to activate one node of the network to start
the simulation. In the example
the node Entry
, indicated in the first argument, will be
activated at a time equal to the time of the initialization
(that is 0 by default) plus the value of the
second argument (also 0 in this example). Thus, it is activated
at the beginning of the simulation.
Values are assigned to the parameters Tba
, MeanWait
and StaDev
.
Complete algorithms may be included in this section.
In this section may also be assigned: capacities to R nodes,
values to user defined functions, frequency table parameters
and database tables. See Chapter 3 for details.
The subsection VAR contains the declarations of the variables. The subsection STATISTICS may contain node names and variable names from which statistics are wanted. In this case only node statistics are requested.
Other declarations of data corresponding to the base language may be done here (types, constants, records, arrays, sets, files). The procedures and functions declared and programmed by the user must be also included in this section.
Function defined by pairs of values (a special feature of the GLIDER language), the data base tables, frequency tables and the structure of the messages must be also declared here. See Chapter 2 for details.
Lexicographic remark:
{ }
or
(* *)