Simulation Lab Manual PDF
Simulation Lab Manual PDF
Definition of Simulation
The simplest definition of simulation is “mimicry of a real situation”. Simulation is the imitation
of the operation of a real-world process or system over time. Simulation involves the
generation of an artificial history of the system, and the observation of that artificial history to
draw inferences concerning the operating characteristics of the real system that is represented.
Modeling Concept
There are several concepts underlying simulation. These include system and model, events,
system state variables, entities and attributes, list processing, activities and delays, and finally
the definition of discrete-event simulation.
System, Model and Events: A system is a group of objects that are joined together in some
interaction or interdependence toward the accomplishment of some purpose. A model is a
representation of an actual system for the purpose of studying the system. A system is often
affected by changes occurring outside the system. In modelling systems, there is a primary
concern about the limits or boundaries of the model that supposedly represent the system. It is
not necessary to consider all the details of a system; thus, a model is not only a substitute for a
system, it is also a simplification of the system. However, there should be sufficient detail in
the model to permit valid conclusions to be drawn about the real system.
An event is an occurrence that changes the state of the system. For example, events may
include the arrival of a customer for service, the beginning of service for a customer, and the
completion of a service.
System State Variables: The system state variables are the collection of all information needed
to describe the system to a sufficient level at a given point in time. The determination of system
state variables is a function of the purposes of the investigation, so what may be the system
state variables in one case may not be the same in another case even though the physical
system is the same.
Entities and Attributes: An entity represents an object that requires explicit definition and that
can change the state of the system. An entity can be dynamic in that it "moves" through the
system, or it can be static in that it serves other entities. For example, the customer is a
dynamic entity, whereas the service provider is a static entity.
Attribute is the property of a given entity. An entity may have attributes that pertain to that
entity alone. Thus, attributes should be considered as local values. For example, an attribute of
the customer entity could be the time of arrival.
Resources: A resource is an entity that provides service to dynamic entities. The resource can
serve one or more than one dynamic entity at the same time, i.e., operates as a parallel server.
A dynamic entity can request one or more units of a resource. If denied, the requesting entity
joins a queue, or may be diverted to another resource, or ejected from the system. If permitted
to capture the resource, the entity remains for a time to get served, then releases the resource.
List Processing: Entities are managed by allocating them to resources that provide service, by
attaching them to event notices thereby suspending their activity into the future, or by placing
them into an ordered list. Lists are used to represent queues. There are many queing rules such
as FIFO (first-in first-out), SPT (shortest process time) etc.
Activities and Delays: An activity is a duration of time whose duration is known prior to
commencement of the activity. Thus, when the duration begins, its end can be scheduled. The
duration can be a constant, a random value from a statistical distribution, the result of an
equation, input from a file, or computed based on the event state.
A delay is an indefinite duration that is caused by some combination of system conditions.
When an entity joins a queue for a resource, the time that it will remain in the queue may be
unknown initially since that time may depend on other events that may occur.
A GPSS program is a sequence of block statements. The block statements determine the
sequence of actions in the simulation. Block Statements are inserted into a GPSS model through
different blocks as given below:
Top Menu
SPSS
Simulation
Program
Area
Block Menu
2. Simulation Exercise (Manual)
Exercise 1: Bank Operation
Consider the operation of a one-teller bank where customers arrive for service in 1 ± 10
minutes. The customers are served in time 1 ± 6 minutes. Simulate the bank operation until
twenty customers are served assuming customer 1 arrives at time 0, and compute measures of
performance such as the percentage of idle time and the average waiting time per customer.
Time distribution:
Operation time in MC 1 = [6, 8] minute
Operation time in MC 2 = [12, 15] minute
Robot pick up time = 0.1 minute
Robot release time = 0.1 minute
Machine loading and unloading time = 0.2 minute
Robot movement from I/P Conveyor to MC 1 = from MC 2 to O/P Conveyor = 1 minute
Robot movement from MC 1 to MC 2 = 0.5 minute
Robot movement from I/P Conveyor to O/P Conveyor = 2 minute
Each alternative would be simulated for three years of 52 weeks of 40 hours. It is desirable to
test the impact of various numbers of repairers and reserve machines on factory and repair
crew utilization so as to achieve balanced resource deployment. (Start with base case of two
repairmen and two reserve machines).
Type A ships require three tugboats for berthing, and two for deberthing. Type B ships, smaller
than Type A ships, only require two tugboats for berthing, and one for deberthing. When a ship
arrives at the harbor, it does these things
1. It requests a berth of the type it uses.
2. After capturing the berth, it requests the tugboats it needs for berthing.
3. After capturing the tugboats, it gets pulled into the berth.
4. It gives up the tugboats.
5. It un/loads cargo.
6. It requests the tugboat(s) it needs for deberthing.
7. It gets pulled out of the berth.
8 It gives up the tugboat(s).
9. It gives up the berth.
10. It leaves the harbor.
Ships obtain tugboats on an "all or nothing at all" basis, The interarrival-time and unloading-
time distributions for Type A ships are 3.2 ± 1.5 hours and 8.4 ± 1.5 hours, respectively. The
respective interarrival-time and unloading-time distributions for Type B ships are 1.5 ± 0.75
hours and 2.1 ± 0.6 hours. Berthing and deberthing times are 30 and 15 minutes, respectively,
independent of ship type.
Build a model for this system, using 1 hour as the base time unit. Gather Queue information by
ship type for ships with respect to the tug-berth wait process. Simulate until a total of 1000
ships have left the harbor. Explore possible ways and means to improve harbor operation
through tug-berth augmentation or leveling.
Patients arrive in a Poisson fashion for treatment at a hospital’s emergency room. Mean patient
interarrival time is 30 minutes. Patients begin by seeing a nurse, who classifies 45% of them as
CW (can wait), and the other 55% as NIA (need immediate attention). There is only one nurse
who classifies patients. Classification time is 10 minutes exponentially distributed.
Two doctors work in the emergency room. NIA patients have higher priority for seeing a doctor
than CW patients. An NIA patient sees a doctor for an average of 45 minutes, exponentially
distributed. Seventy-five percent of these patients then have to wait while lab tests are
performed, whereas the other 25% are finished and can go home immediately.
When needed, lab tests take 30 minutes (exponentially distributed). After completion of lab
tests, NIA patients need to see a doctor again (either doctor), but they have lower priority than
CW patients who haven’t yet seen a doctor. They receive further treatment from the doctor for
15 minutes (exponentially distributed), and are discharged. Note that NIA patients must
(potentially) wait to see a doctor on each of two occasions.
Whereas some NIA patients must see a doctor twice, CW patients only see a doctor once. As
explained above, their priority is lower than that of NIA patients who haven’t yet seen a doctor
at all, but is higher than that of NIA patients waiting to see a doctor for the second time.
Treatment of CW patients averages 30 minutes (exponentially distributed).
Build a model for the situation. Design the model to gather Queue information at each of the
four points of potential waiting in the system. Simulate the model through a 240-hour period,
assuming no changes take place in the system during this period. Discuss the results of the
simulation.
4. Monte Carlo Simulation
The Monte Carlo simulation is a numerical method for statistical simulation which utilizes
sequences of random numbers to perform the simulation. The specific feature of Monte
Carlo simulation is propagation of uncertainties in model inputs into uncertainties in model
outputs. Hence, it is a type of simulation that explicitly and quantitatively represents
uncertainties.
In Monte Carlo simulation, the entire system is simulated a large number (e.g., 1000) of times.
Each simulation is equally likely, referred to as a realization of the system. For each realization,
all of the uncertain parameters are sampled (i.e., a single random value is selected from the
specified distribution describing each parameter). The system is then simulated through time
(given the particular set of input parameters) such that the performance of the system can be
computed. This result is a large number of separate and independent results, each representing
a possible “future” for the system (i.e., one possible path the system may follow through time).
The results of the independent system realizations are assembled into probability distributions
of possible outcomes. As a result, the outputs are not single values, but probability
distributions.