Professional Documents
Culture Documents
H. K. Eldin, Ph.D.
Oklahoma State University
Stil lwater, Oklahoma
B. J. Schroer
Computer Sciences Corporation
Huntsville, Alabama
Empty vehicles arrive at the terminal for a load of In describing the simulation model the following areas
goods. The arrival of the vehicles follows a Poissondistri- will be discussed- model assumptions, programming language
bution. The mean arrival rate of the vehicles is dependent and computer requirements, unique features, model input,
on the time of day. Therefore, the day is divided into hourly model output, and model execution. Each of these areas will
increments, starting a t 7 A M a n d ending a t 4 PM. Each be discussed in the following paragraphs.
hourly increment has its own mean arrival rate.
386
Model Assumptions Unique Features of the Proqram
The following assumptions have been made in the In developing this relative simple simulation program
development of the vehicle loading simulation model: it became apparent that the MACRO feature of GPSS offered
great potentials in making the program a utility program.
1. The following time periods have been defined Since the arrival patterns were variable and depended on
the time of day, the majority of the program logic could be
7AM - 8AM defined in a MACro. As a result, the "main-line" of the
8AM - 9AM program appeared as shown below:
9AM - lOAM
lOAM - 11AM
11AM - 12AM
12AM - 1PM
1PM -2PM
2PM - 3PM
3PM - 4PM. TIME PERIOD 8 AM TO 9 AM
. Any vehicles which have not been loaded by SPI..IT 1,TIME9
4PM will be loaded before the loading crews TRUCK MACRO X72,V22,2,EIGHT,BACK9,ARVL9
are dismissed for the day. TIME9 ADVANCE 60
TIME PERIOD 9 AM TO 10 AM
3. A loading crew exists for each loading facility.
SPLIT 1,TIMIO
. All arriving vehicles form a single queue. The TRUCK MACRO X 7 3 , V 2 3 , 3 , NINE,BACK2 ,ARVL2
polling sequence starts with facility one and TIMIO ADVANCE 60
then continues with facility two, three, etc.,
to a maximum of five facilities. If no empty -k
TIME PERIOD 10 AM TO 11 AM
facilities are found the polling sequence is
repeated. SPI_IT 1,TIM11
TRUCK MACRO X74,V24,4,TEN,BACK3,ARVL3
. The time between arrival of vehicles within a TIM11 ADVANCE 60
given time period follows a negative exponential
distribution.
6. The distribution of the size of the load can be
divided into "size" classes such as
Class Load (size) Frequency Another unique feature is that all input to the pro-
rancle gram is through the use of the INITIAL and the FUNCTION
cards. A brief description of the input procedures is pre-
1 1 - 2 units fl sented in a later paragraph.
2 2 - .3 units f2
To assist in making the program a utility program,
3 _3 - 4 units f3
the logic included the feature of inputting via an INITIAL
4 4 - 5 units f4" card the selection of either the normal or the exponential
distribution for the service time.
7. The time to load a vehicle is dependent on the
Another unique feature of the program is the use of
load "size" and can follow a normal or an
the redefinition feature of GPSS. This feature permitted
exponential distribution.
the changing of selected logic blocks, after starting a
. The maximum number of loading facilities is number of transactions, without manually modifying the
cards (i .e., blocks) and then reassemblying.
five. Each bay can load only one vehicle at a
time.
Model Input
. The loading crews break for lunch between 11AM In keeping with one of the previously defined de-
and 12AM. Vehicles still arrive during the sirable characteristics of a utility program, all input to the
break. program is through the INITIAL and the FUNCTION cards.
Programming Language and Computer Requirements
It has been assumed that the mean arrival rate of the
A generalized flow diagram of the simulation program vehicles is dependent on the time of day. Therefore, the
program has been divided into nine hourly increments
is presented in Figure 2 . The program is written in the IBM/
GPSS (General Purpose Simulation System) language. The starting at 7AM and ending a t 4 P M . Since the number of
arrivals in an hourly increment follows a Poisson distribu-
program consists of one MACRO, four FUNCTIONS, eighteen
variables, and twelve TABLES. After the MACRO has been tion, the time between arrivals follows a negative
inserted into the appropriate logic, the length of the program exponential distribution. The mean time between arrivals
approaches 2 5 0 blocks. is equal to the reciprocal of the mean arrival rate. There-
fore, the mean time between arrivals is inputted via the
INITIAL cards. For the truck loading problem (see the
The program is setup to run in a 128K partition on sample problem in a later section), these INITIAL cards
the IBM _360 series computers. However, it should be
possible to run the program in a 64K partition on the IBM were defined as:
3 6 0 series computers. To do this would require the use of
the GPSS REALLOCATE feature. Approximate compilation
time on the IBM 3 6 0 / 6 5 is 13 seconds.
3 8 7
MEAN TIME BETWEEN TRUCKS ARRIVING STANDARD DEVIATIONS OF TIME TO LOAD
BETWEEN TIME I AND TIME J TRUCK WITH TONNAGE RANGE OF I TO J TONS
3 FUNCTION RN1,D6 The program has been setup to simulate a nine hour
0.1 7,1/0.41,2/0 . 65,3/0.74,4/0.89,5/1.0,6 day starting at 7AM and ending at 4 P M . If vehicles are
still in the system at 4 P M , the program will continue
execution until all the vehicles have been loaded. Multiple
nine hour days are simulated by varying the argument of the
The time to load a vehicle is dependent on the START card. For example to simulate ten days the START
vehicle's load (see above). Therefore, each size class has card would be defined as:
its own loading time distribution. The loading time dis-
tributions for the sample problem are normally distributed. START 10
Therefore, SAVEVALUE X H l w a s initialized to 1, sig-
nifying the use of the normal distribution. The corres- It may be of interest to study the loading terminal's
ponding means and standard deviations are then inputted characteristics with fewer than five loading facilities. A
via the INITIAL cards. For the sample problem the feature of the program is that these changes may be made to
INITIAL cards were defined as: the simulation program without directly changing the basic
program. Instead, the program is indirectly changed by the
MEAN TIME TO LOAD TRUCK WITH TONNAGE use of the GPSS redefinition feature. These indirect
RANGE OF I TO J TONS changes can best be described by an example.
* 1 - 2 TONS If in the truck loading problem it was of interest to
INITIAL XH31,24 study the terminal's characteristics under five, four, three,
* 2 - 3 TONS and two loading facilities, the following cards would be
INITIAL XH32,30 added to the simulation program:
* 3 - 4 TONS
INITIAL XH33,28
* 4 - 5 TONS
INITIAL XH34,29
* 5 - 6 TONS
INITIAL XH35,48
* GREATER 6 TONS
INITIAL XH36,60
388
START50 error that is made by considering the system in equilibrium.
RMULT1,31 Since the assumption was made that all trucks would be
CLEARXH2I-XH42, XHI loaded before the crews are dismissed for the day, the pro-
CHG TRANSFER
ALL,BAYN1,BAYN4,14 blem of determining when the system has reached equilibrium
START50 could be ignored.
RMULT1,31
CLEARXH2I-XH42, XHI The length of time required to obtain the state
CHG TRANSFER
ALL,BAYN1,BAYN3,14 probability distribution which is independent of the starting
START50 conditions must certainly depend on the starting conditions
RMULT 1,31 of the system. One of the most common ways of starting
CLEAR XH2I-XH42, XH1 a Monte Carlo simulation is in the empty and idle condition.
CHG TRANSFER ALL,BAYN1,BAYN2,14 That is, at the start of execution, all queues are empty
START 50 and all facilities are idle. Therefore, it is obvious that if
the model is started in a state other than zero, the time for
The first START 50 card causes the program to the system to reach equilibrium should be reduced. Based
simulate fifty days of operation with five loading bays. on the previous assumption for the truck loading simulation,
The RMULT 1 , 3 1 card resets the random number multipliers the starting conditions for each simulated day were "empty
to 1 and 3 1 . The CLEAR X H 2 1 - X H 4 2 , X H 1 "zeroes-out" and idle." That is, all queues were empty and all loading
the output statistics; however, savevalues XH21-XH42 facilities were idle at the start of each day.
and XH1 are not reset to zero. These savevalues contain
the mean time between arrivals and the means and standard A similar problem exists for stopping a simulation
deviations of the loading times. The TRANSFER block run as for determining equilibrium at the beginning of the
modifies the TRANSFER block which is labeled CHG in the run. Many times a simulation run is terminated by stopping
simulation program. This modification to the TRANSFER the creation of new events for the system and by allowing
block will cause the program to transfer only between loading the system to return to an empty and idle condition. By
facility one and facility four (block BAYN1 and block including the measurements collected from the time following
BAYN4). The START card will cause the program to simu- termination of new events will likewise introduce a bias
late another fifty days. which can be serious, especially if the total run is not long.
Based on the previous assumption, the stopping conditions
To further reduce the number of loading facilities for each simulated day were when all the trucks which
requires a similar sequence of cards. Note that the only arrived during the day had been loaded; therefore leaving the
diff.erence in the subsequent sequences is the TRANSFER system empty and idle at the end of the day.
block where the argument BAYN4 is changed to BAYN3 and
to BAYN2, thereby resulting in the simulation of only three
and two loading facilities, respectively. A problem which was considered is that of the vari-
ability associated with the measurements from the model.
Truck Loadin.q Simulation Fortunately, a large portion of the real world problems only
require a comparison of alternatives. This is one of the
The truck loading problem for which the simulation real benefits of simulation. The simulation model can be
program was initially written consisted of studying the used to produce relative results much more efficiently than
system characteristics of a loading terminal with four, three, absolute results. The relative approach was used in study-
and two loading facilities. The system corresponded to the ing the various terminal configurations in this problem.
previously defined assumptions, with the service times
being normally distributed. The data input has been pre- By reproducing the same sequence of random numbers
viously presented in the model input section. for each alternative ( i . e . , terminal configuration), it is
possible to reproduce the identical sequence of events.
Some of the data used in the analysis of the truck This increases the contrast between terminal configurations
loading problem is presented in Figure 3 through Figure 7. by reducing the residual variation in the differences in the
Figure 3 presents the utilization of the loading bays for total performance of the system; therefore, smaller samples
the three terminal configurations. Figure 4 gives an indi- are required to detect any statistically significant differ-
cation of the maximum queue size which developed during ences.
the simulation. Figure 5 presents the average delays for
those trucks which had to wait. The procedure for comparing two alternatives is to
pair the results regarding the performance of the system
Figures 6 and 7 were of primary interest since they that were produced by the same events. Since these pairs
presented an indication of the amount of overtime required of events are obtained under the same conditions, the
to load the trucks and of the time the crews were idle. differences between them become the relevant sample ob-
Analysis servations. This sample is used to test the hypothesis
that the mean of these differences is zero and to obtain a
confidence interval of the mean. This test indicates
Considerable care was taken in setting up the simu-
lation runs to insure the maximum validity of the data with whether there is a significant difference between the means
the minimum sample size. Several problem areas which of the performance of the system for the two alternatives.
exist in most Monte Carlo simulations and which are often
ignored are (1) when should measurements be collected from
a simulation (i .e., when has equilibrium been approached),
(2) what should be the initial starting conditions of the simu-
lation, (3) what should be the stopping conditions of the
simulation, and (4) what should be the sample size.
5
~= ffl~'-' (S i a l t l - s i altL~),
i=1
U 4m.~
u c
o
o N~
V] [I [I II .tJ o
o
I II
% o o,--~
~ ~.~ ~ o
u~
>. ~4.~ ~
u o
~J
.H ~"
~0 U .,~,'~ ~ e'~
C
m o g&%
•~ o
o ©
~.~ u
~
o o C u
i o
~c
I;I
o >
C~ .~
i
u~
u
i i ~
!
.C
~ .,~ ,-~
o
U
•~ ~ ~
.C ~Cm~
>
<
II
391
O
I
Set number
of facili-
toe5
ISeI = 7AM
• 8AM
Index i
and j by
one hour
~> 4 P M ~
I Dwell 60
minutes
]ontinue
Generate | loading al]
arrival of | ~ehicles
vehicle based
on time ii !
Determine s imu i.
vehicle
load
Output
t Results ~e pnogram
I
Wait for
open
facility
Select firs1
~educe fao
ilities by
End vailable
acility
Load
vehicle
Collect F Vehicle
Statistics exits
392
1.0
J
0.8
o0.6
.r4
N
.~ 0.4
r-~
4-}
0.2
0.0 A • A A
BAY1 BAY2 BAY1 BAY2 BAY3 BAYI BAY2 BAY3 BAY4
Two bays Three bays Four bays
Figure 3. Loading Bay Utilizations
u 20
~' 0
Number of bays
¢)
80
.r4
60
~ 4o
Number of bays
393
60
50
u~
40
30
20
[-~
10
• • A
Two Three Four
Number of Bays
Figure 6. Average Time Required After 4PM to Load
Those Trucks Still Waiting
1800
1600
Total daily idle time
of loading crews
1400
u~
+~
1200
o 800
.,..4
600
400
• • J&
200
Two Three Four
Number of Bays
Figure 7. Total Daily Wai~ing Time of Trucks vs
Total Daily Idle Time of Loading Crews
394