Simulation Software
Chapter-9
Compiled By: Bal Krishna Nyaupane
[email protected]
1
9.1 Introduction to Simulation Software
Three types of software for simulation models developments:
1. General-purpose programming languages, e.g., Java, C.
• Not specifically designed for use in simulation.
• simulation libraries, e.g., SSF, are sometimes available for standardized simulation
functionality.
• Helps to understand the basic concepts and algorithms.
2. Simulation programming languages, e.g., GPSS/HTM, SIMAN V®and SLAM II®.
• Designed specifically for simulation of certain systems, e.g. queueing systems.
3. Simulation environnent, e.g., Arena, AutoMod.
• Output analyzer is an important component, e.g. experimental design, statistical analysis.
• Many packages offer optimization tools as well.
One of the important components of a simulation environment is the output analyzer, which is used to
conduct experimentation and assist with analyses. To illustrate the range of desirable characteristics, we
look at statistical analysis tools, compute summary statistics, confidence intervals, and other statistical
measures. In addition to the support for statistical analysis and optimization, the simulation
environments offer data management, Scenario definition, and run management
2
9.2 Selection of simulation Software
There are many features that are relevant when selecting simulation software. Some of
them are as follows:
• Model building feature
• Runtime environment
• Animation of layout features
• Output features
• Vendor support and product documentation
3
9.2 Selection of simulation Software: Model building feature
4
9.2 Selection of simulation Software: Runtime environment
5
9.2 Selection of simulation Software: Animation of layout features
6
9.2 Selection of simulation Software: Output features
7
9.2 Selection of simulation Software: Vendor support and product
documentation
8
9.3 Simulation in Java
Java is widely used programming language that has been used extensively in simulation. It
does not provide any facilities directly aimed at aiding the simulation analyst.
The runtime library provides a random-number generator. Java supports modular construction
of large models.
Simulation libraries alleviate the development burden by provides access to standardized
simulation functionality and by hide low-level scheduling minutiae.
Discrete-event simulation model written in Java contains the following Basic components:
• System state
• Entities and attributes
• Sets
• Events
• Activities
• Delays
9
9.3 Simulation in Java
The following components are common to almost all models written in Java:
• Clock: A variable defining simulated time
• Initialization method: A method to define the system state at time 0.
• Min-time event method: A method that identifies the imminent event, that is, the
element of the future event list (FutureEventList) that has the smallest time-stamp.
• Event methods: For each event type, a method to update system state (and
cumulative statistics) when that event occurs.
• Random-variate generators: Methods to generate samples from desired
probability distributions.
• Main program: To maintain overall control of the event-scheduling algorithm.
• Report generator: A method that computes summary statistics from cumulative
statistics and prints a report at the end of the simulation.
10
9.3 Simulation in Java: The Overall structure of Java Simulation
11
9.3 Simulation in Java: The Overall structure of Java Simulation
The simulation begins by setting the simulation Clock to zero, initializing cumulative statistics to
zero, generating any initial events and placing them on the FutureEventList, and defining the
system state at time 0.
The simulation program then cycles, repeatedly passing the current least time event to the
appropriate event methods until the simulation is over.
At each step, after finding the imminent event but before calling the event method, the simulation
Clock is advanced to the time of the imminent event. Next, the appropriate event method is called
to execute the imminent event, update cumulative statistics, and generate future events.
Executing the imminent event means that the system state, entity attributes, and set membership
are changed to reflect the fact that the event has occurred. Notice that all actions in an event
method take place at one instant of simulated time. The value of the variable Clock does not
change in an event method.
If the simulation is not over, control passes again to the time-advance method, then to the
appropriate event method, and so on.
When the simulation is over, control passes to the report generator, which computes the desired
summary statistics from the collected cumulative statistics and prints a report.
12
9.3 Overall structure of Java Simulation of a Single Server Queue
13
9.3 Definitions of Variables, Functions, and Methods in a Single Server
Queue
System state: Queue Length and Number-in-Service (Number being served at current simulated time)
Entity attributes and sets: Customers -FCFS Queue of customers in system
Future event list: FutureEventList- Priority-ordered list of pending events
Activity durations
• MeaninterArrivalTime - The interanival time between the previous customer's arrival and the next
arrival
• MeanServiceTime - The service time of the most recent customer to begin service
Input parameters
• MeaninterarrivalTime - Mean interarrival time (4.5 minute)
• MeanServiceTime - Mean service time (3.2 minutes)
• SIGMA - Standard deviation of service time (0.6 minute)
• Total Customers - The stopping criterion- number of customers to be served (1000)
Simulation variables: Clock - The current value of simulated time
Statistical Accumulators
• LastEventTime - Tune of occurrence of the last event
14
• TotalBusy - Total busy time of server (so far)
9.3 Definitions of Variables, Functions, and Methods in a Single
Server Queue
• MaxQueueLength - Maximum length of waiting line (so far)
• SumResponseTime - Sum of customer response times for all customers who have departed
(so far)
• NumberOfDepartures - Number of departures (so far)
• LongService - Number of customers who spent 4 or more minutes at the checkout counter
Function
• eXponential(mu) :Function to generate samples from an exponential distribution with mean
mu
• normal (xmu, SIGMA): Function to generate samples from a normal distribution with mean
xmu and standard deviation SIGMA
Methods
• Initialization - Initialization method
• ProcessArrival - Event method that executes the arrival event
• ProcessDeparture - Event method that executes the departure event
• ReportGeneration : Report generator 15
9.3 Structure of initialization method AND The output of SSQ
16
9.4 Simulation in GPSS
GPSS is a highly structured, special-purpose simulation programming language based on the
process-interaction approach and oriented toward queueing systems.
A block diagram provides a convenient way to describe the system being simulated. There are
over 40 standard blocks in GPSS.
Entities called transactions may be viewed as flowing through the block diagram. Blocks
represent events, delays, and other actions that affect transaction flow.
GPSS can be used to model any situation where transactions (entities, customers, units of
traffic) are flowing through a system (e.g., a network of queues, with the queues preceding
scarce resources).
The first version of GPSS was released by IDM in 1961. It was the first process-interaction
simulation language and became popular; it has been implemented anew and improved by many
parties since 1961, with GPSS/H being the most widely used version in use today.
GPSS/H includes built-in file and screen I/O, use of an arithmetic expression as a block
operand, an interactive debugger, faster execution, expanded control statements, ordinary
variables and arrays, a floating point clock, built-in math functions, and built-in random-variate
generators. 17
GPSS block diagram for the single-server queue simulation.
18
9.4 Simulation in GPSS
GENERATE RVEXPO ( 1 , &IAT): Random variable, exponentially distributed
QUEUE SYSTIME: Begin response time to data collection in queues
QUEUE LINE: Customer joins waiting line before cashier
SEIZE CHECKOUT: Begin checkout at cash register (Give up the use of facility)
DEPART LINE: Customer starting service leaves queue
ADVANCE RVNORM ( 1 , &MEAN , &STDEV): Customer' s service time ( Random
variable and normally distributed )
RELRASE CHECKOUT: Customer leaves checkout area
DEPART SYSTIME: End of data collection for response time
TEST GE M1 , 4 , TER: Is response time greater than equal to 4 minutes?
BLET &COUNT=&C0UNT+1 : If so, add 1 to counter
TERMINATE 1
START &LIMIT: It’s control the length of Simulation with given LIMIT value.
19
9.5 Simulation in SSF
The Scalable Simulation Framework (SSF) is an Application Program Interface (API)
• Describes a set of capabilities for object-oriented, process-view simulation.
• The API is sparse and allows implementations to achieve high performance, e.g. on parallel
computers.
• A widely used base, particularly in network simulation by using the add-on framework
SSFNet.
• The SSF API defines five base classes.
• Process is a class that implements threads of control; the action method of a derived class
contains the execution body of the thread.
• The Entity class is used to describe simulation objects. It contains ·State variables,
processes, and communication endpoints.
• The in Channel and out Channel classes are communication endpoints.
• The Event class defines messages sent between entities.
SSF bridges the gap between models developed in pure Java and models developed in languages
specifically designed for simulation.
It also provides the flexibility offered by a general-programming language, yet has essential
20
support for simulation.
9.5 Simulation in SSF: Single Server Queue Example
The Job arrival process example is built on two SSF processes. One of these generates jobs
and adds them to the system; the other services the enqueued jobs.
Class SSQueue is a class that contains the whole simulation experiment. It uses the
auxiliary classes Random and Queue. SSQueue defines experimental constants and contains
SSF communication endpoints out and in, through which the two processes communicate.
SSQueue also defines an inner class Arrival:
Stores the identity of entity
Creates random number generator
Generate and enqueued a new arrival, and then block for an inter arrival time.
Server process:
This process is called when a job has completed service or by a signal from the arrival
process.
Update statistics.
Customer is dequeued from the waiting list or the process suspends if no customer was
waiting.
21
9.5 SSF model of Job Arrival Process
22
9.5 SSF model of Single Server Queue: Server
23
9.6 Simulation Software - Arena
Arena can be used for simulating discrete and continuous systems.
The Arena Basic Edition:
• For modeling business processes and other systems in support of high level analysis needs.
The Arena Standard Edition:
• For modeling more detailed discrete and continuous systems.
• Models are built from graphical objects called modules to define system logic and physical
components.
• Includes modules focused on specific aspects of manufacturing and material-handling systems.
The Arena Professional Edition:
• With capability to craft custom simulation objects that mirror components of real system, including
terminology, process logic, data, etc.
The Arena family includes:
• OptQuest: an optimization software package.
• Arena Contact Center and Arena Packaging: designed specifically to model call centers and high-
speed production lines.
Arena’s Input Analyzer automates the process of selecting the proper distribution and its inputs.
24
The Output Analyzer and Process Analyzer automate comparison of different design alternatives.
9.6: Simulation Software - AutoMod
AutoMod Product Suite includes:
• AutoMod simulation package, AutoStat for experimentation and analysis, and AutoView
for making AVI moves of the built-in 3-D animation.
Main focus: manufacturing and material-handling systems (has built in templates.)
Also contains a full simulation programming language.
Strength: detailed, large models used for planning, operational decision support, and control-
system testing.
An AutoMod model consists of one or more systems.
• A system can be either a process system or a movement system.
• A model may contain any number of systems, which can be saved and reused as objects
in other models.
AutoStat provides a complete environment for the user to define scenarios, conduct
experimentation and perform analysis.
Optimization is based on an evolutionary strategies algorithm.
25
Thank You
???
26