Modeling and Simulation Worldviews
Modeling and Simulation Worldviews
John S. Carson
This paper introduces the major world views of A model is simply a representation of a system.
simulation modeling from the perspective of a person The system should be defined with clear boundaries
about to begin development of his or her first model between the outside world and the portion of the
using a discrete-event simulation language. The world being simulated. Generally, the system
purpose is to give modelers increased understanding components are simulated in varying degrees of
of the world views built into the major commercially detail, depending upon their perceived importance
available simulation languages. Both the article and with respect to the modeling objectives, while the
the tutorial are introductory in nature and are meant outside world is simulated only to the extent that
for the reader new to discrete-event simulation. specific events impinge upon the system. A simple
First, we discuss the basic concepts: system state, example is random arrivals (from the outside world)
events, entities, and activities. Then we discuss the that place demands upon system resources.
event-scheduling world view, historically the first A discrete-event simulation model is a specific
approach to discrete-event systems simulation. type of model that may be contrasted to other types
Finally we discuss the process interaction and such as mathematical models, descriptive models,
transaction flow world views, and their statistical models, and input-output models. A
implementation through process procedures, block discrete-event model attempts to represent the
diagrams, or arcinode representations. components of a system and their interactions to a
In the tutorial, we will illustrate how a modeler level of detail sufficient to meet the objectives of the
may take more than one view of a given problem, study and to answer the questions appropriate to
leading to a number of possible models of one those objectives.
system. Through an example, we illustrate how a With their detailed representation of system
simple problem can be modeled in more than one components, discrete-event models stand in contrast
to some mathematical, statistical and input-output
18
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.
Modeling and Simulation Worldviews 19
models that represent a system's inputs and outputs events. For example, interarrival times may be
explicitly, but attempt to represent the inner workings characterized by a statistical distribution and
by a mathematical or statistical relationship derived generated in the model by sampling from this
empirically or on some other ad hoc basis, not by a distribution. This is one way among many of
detailed representation of the actual inner workings. generating (i.e. computing) the time of occurrence of
Some mathematical models, for example those from a future arrival event.
physics, are based on a theory and are not merely The so-called event times are recorded in event
empirical as are many statistical models based solely notices and placed in a list called the event list. The
on data. event list is managed by the underlying simulation
Discrete-event models are dynamic with respect to software system in such a way (discussed later) as to
time. In other words, time plays a crucial role in the cause events to occur at proper times in the model.
sense that the variables defining system state are Note that an event occu~sat an instant of time; it does
functions of time. Many mathematical, statistical and not have a duration.
spreadsheet models are static; they represent a Examples: an arrival to a system; the completion
system's state at a fixed point in time. of service at a particular service center; a breakdown
Discrete-event models can also be differentiated of a machine.
from continuous models, based on the nature of the In Section 2.6, we distinguish two types of event,
variables needed to track system state. The system the primary or unconditional event, and the
state variables in a discrete-event model remain secondary or conditional event.
constant over intervals of time and change value only
at certain well-defined epochs (points in time) called 2.4 Entities, Attributes and Lists
event times. On the other hand, continuous models
have system state variables defined by differential or An entity in a model represents some object or
difference equations and thus its variables change element of the system that needs to be explicitly
continuously over time. Some models are mixed modeled. An entity may be dynamic in nature in the
continuous and discrete, simply due to the nature of sense that it "moves" through the system, or it may
the system being modeled or because of modeling be static in the sense that it services other entities.
efficiencies. For instance, in some circumstances, Examples: a customer in a queueing system
discrete systems can be efficiently modeled with (dynamic entity); a server in a service system
continuous models, and continuous systems with (dynamic or static depending on how modeled).
discrete models. An entity may have one or more attributes, or
We give a more precise definition of discrete-event properties, that belong to that entity. There may be
modeling after further discussion of system state and many entities of a particular entity class, all having
events. the same attributes but each having its own value for
an attribute.
2.2 System State Variables Examples: (1) The set of all customers is an
entity class with attributes of demand, due date and
As implied in the previous section, system state priority. Each individual customer entity may have
variables are the collection of all variables needed to unique values for demand, due date and priority.
define system state to a level of detail sufficient to (2) A server may have a service rate
meet the project's objectives. Determining those and a schedule.
variables is matter of art and experience as much as Typically, entities are managed by attaching them
science. Fortunately, for the most part, the act of to resources (discussed next in section 2.5) that
modeling, of putting a model together, will bring to provide service to them, by attaching them to event
the fore any initial oversights in identifying system notices (thus suspending their activity until some
state variables. future time). or by placing them into an ordered list.
Lists of entities are used to represent queues, places
2.3 Events and Event Notices in a system where entities are forced to wait due to
scarce resources or other system conditions. In the
An event in a model corresponds to a happening in simulation literature (and in simulation languages),
the real system that changes or potentially changes lists are variously referred to as queues, files, chains
the state of the system. In a model, future events are or some other similar term. A list may have a FIFO
modeled by making assumptions or using collected ordering ( f i t - i n , first-out), so that entities are joined
data regarding the times of occurrences of these to the back of the list and removed from the front of
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.
20 Carson
the list. In fact, a list may be FIFO, LIFO (last-in, state, or is at most a computable function of past and
first-out), or sequenced by a specified attribute of an current system state. As we will see, an activity time
entity. For example, a set of entities representing usually "holds" a dynamic entity for its duration.
orders may be sequenced on a list from smallest to Examples: service times, time to failure of a
largest due date, representing the priority in which machine or component, time between arrivals
orders are to be handled. Some typical examples include:
A resource is a type of entity that provides service where MINUTES refers to simulated time units, or
to other entities. A resource may have a capacity,
typically representing a number of servers in parallel. WAIT FOR EXPONENTIAL(10.2) MINUTES
Typically, a dynamic entity may request one or more
units of a resource. If denied, the entity joins a where the wait is for a random amount of time
queue to wait or takes some other specified action; if generated as a sample from an exponential
not denied, the entity captures the units of the distribution having mean 10.2 minutes.
resource for a duration of time and eventually In contrast to an activity time, a delay is an
releases the units of the resource. indefinite duration of time that is caused by some
Typically at minimum, a single-unit resource has a combination of system conditions. The nature of a
status attribute representing busy and idle states; delay is expressed by the pseudo-code:
more generally, a multi-unit resource has an attribute
for number of captured or busy units. In many WAIT UNTIL CONDITION y IS TRUE
language implementations of these concepts, a
resource may have additional attributes representing meaning that a process or entity is "held" until some
other possible states. These may have a name such as specific system condition becomes true. Typically in
availability (two values: available and unavailable). complex real-world models, a delay is a complex
Examples: a single server in a queueing system; a function of current and future system states and
bank teller; a machine; a grouping of two automated cannot be computed ahead of time. Only the dynamic
teller machines. "working out" of the simulation logic can determine
A resource is manipulated by two actions, here the duration of a delay. Specific examples of delays
called CAPTURE and FREE, and typified by the include:
following pseudo-code referring to a resource called
MACHINE: WAIT IN A QUEUE TO BE SERVICED
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.
Modeling and Simulation Worldviews 21
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.
22 Carson
language such as FORTRAN, Pascal, or C. There because active processes may interact as they compete
are a number of commercially available libraries of for limited resources and in other ways. This process
routines in FORTRAN and other languages to interaction is handled essentially automatically by
facilitate the programming of event oriented languages that utilize the process world view.
simulation models. These libraries of event- As an example, consider customers arriving at a
scheduling routines implement tasks common to all bank and queueing for service from the three tellers
event oriented models, such as management of the on duty. Here is some pseudo-code representing a
event list, management of lists of entities (queues), customer process:
statistics collection for output reporting, and
management of resources. CUSTOMER PROCESS:
A number of commercially available simulation CUSTOMER ARRIVES (arrival event)
languages that emphasize a process interaction or 'A' I F ALL UNITS OF TELLER (entity joins list)
transaction flow world view also have an (optional) RESOURCE ARE BUSY,
built-in event-scheduling world view, and allow a JOIN TELLER-QUEUE
model to be a mix of process and event oriented ELSE (capture resource)
routines. 'C' CAPTURE ONE TELLER
Example: A simple single server queue can be WAIT FOR x TIME UNITS
modeled with three primary events: FREE TELLER (free resource)
- Arrival event ENDIF
- Service completion event CUSTOMER DEPARTS (departure event)
- Stopping event
Consequently, the model will have three event Actually, to have a complete model requires at
routines. The arrival routine would increment the least two other abstract processes, or the customer
number of customers in the system (i.e. change entity must take on additional duties that do not,
system state) and conditionally trigger a "begin strictly speaking, correspond to customer activity in
service" event. That is, if the server's status was idle the real world. The two processes referred to are one
upon arrival, the server becomes busy. Beginning to create additional future arrivals and the second to
service is a conditional event. Similarly, the modeler remove a CUSTOMER entity from the list called
would have to develop the logic and code for the TELLER-QUEUE whenever a service completion
other two primary events. event occurs.
The arrival process can be modeled in several
3.2 Process interaction world view different ways. One is to envision the line
"CUSTOMER ARRIVES'' above as a subsidiary
The process interaction world view provides a way process that is used to "generate" future arrivals, as
to represent a system's behavior from the point of illustrated by the following pseudo-code:
view of the dynamic entities moving through the
system. A process is a time-ordered sequence of CUSTOMER ARRIVAL PROCESS:
events, activities and delays that describe the flow of ' S ' GENERATE T = INTERARFUVAL TIME
a dynamic entity through a system. WAIT FOR T TIME UNITS
Languages implementing a process interaction CREATE NEW CUSTOMER ENTITY
world view require the modeler to write process SEND NEW CUSTOMER ENTITY TO
routines, which are quite different from event CUSTOMER PROCESS, LOCATION
routines. While event routines occur in zero time, 'A'
process routines may contain both activities and GO TO 'S'
delays. Process routines are not possible in ordinary
programming language such as FORTRAN and Many process interaction languages implement
Pascal; they require special mechanisms for such an entity arrival process in one statement in the
interrupting and suspending the execution of a language, so that a modeler does not have to
routine, and resuming execution at a later simulated explicitly program such processes.
time under the control of an intemal event scheduler. We also may need to create an abstract process, or
(Internally but hidden from the view of the modeler, extend the customer entity's duties, to bring the first
there are still events being scheduled and an event list customer off the queue whenever a teller becomes
being manipulated.) idle, perhaps as follows:
This world view is call process interaction,
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.
Modeling and Simulation Worldviews 23
Authorized licensed use limited to: Carleton University. Downloaded on December 13,2023 at 18:29:12 UTC from IEEE Xplore. Restrictions apply.