Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
165 views

Simulation

This document provides an introduction to simulation and discusses key concepts. It defines simulation as modeling the behavior of systems over time for purposes such as training or experimentation. The document outlines different types of models including physical, mathematical, and conceptual models. It also classifies simulation methods as prescriptive/descriptive, discrete/continuous, stochastic/deterministic, static/dynamic, and open loop/closed loop. Finally, it discusses the steps involved in a simulation study including problem formulation, model conceptualization, validation, experimental design, and implementation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views

Simulation

This document provides an introduction to simulation and discusses key concepts. It defines simulation as modeling the behavior of systems over time for purposes such as training or experimentation. The document outlines different types of models including physical, mathematical, and conceptual models. It also classifies simulation methods as prescriptive/descriptive, discrete/continuous, stochastic/deterministic, static/dynamic, and open loop/closed loop. Finally, it discusses the steps involved in a simulation study including problem formulation, model conceptualization, validation, experimental design, and implementation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

1.

0 Introduction

1.1 What is simulation?


―to feign; to have or to assume a false appearance of; to mimic; to recreate conditions of, for the purpose of
training or experimentation‖
Harrell and Tummy (1997) ―simulation is an activity whereby one can draw conclusions about the behaviour of
a given system by studying the behaviour of a system whose cause and effect relationships an the same as ( or
similar to) those of the original.‖
Pedgen et al (1995) ―simulation modelling is an experimental and applied methodology that seeks to accomplish
the following:
 describe the behaviour of systems
 construct theories or hypothesis that account for the observed behaviour
 use the model to predict future behaviour that is the effects produced by changes in the system or in
its method of operation
Simulation is a modelling and analysis tool widely used for the purpose of designing, planning and control of
systems (manufacturing or services). A simulation model may provide information within a few minutes for an
analysis of long term implications of a change in maintenance policy.

1.2 Types of models


A Model is defined as a representation of a system for the purpose of studying the system.

1.2.1 Physical models


Scale models of the actual system. They are static and do not show interactions. Highly specific and
cannot be easily altered

1.2.2 Mathematical models


Uses equations to represent important factors of a system

1.2.3 Conceptual
Concepts and beliefs in the analyst‘s mind

1.3 Classification of methods


 prescriptive or descriptive,
 discrete or continuous
 stochastic or deterministic
 static or dynamic
 open loop or closed loop

1.3.1 Prescriptive or Descriptive


Prescriptive models are those in which a problem is analytically formulated and optimised to give a best
solution. On the other hand, descriptive models are those which merely describe the system behaviour with the
optimisation process left to the analyst. The model to be used in this study is descriptive since the
experimentation and optimisation has to be left open to enable use of various policies.

1.3.2 Discrete or Continuous


The discrete event or continuous classification refers to the model variables. Discrete event simulation products
are used for modelling systems that change state at discrete points in time as a result of specific events. This
includes most manufacturing and services systems. If alterations to the model occurs continuously as time
varies, then the model is classified as continuous.
1.3.3 Stochastic or Deterministic
The difference between stochastic and deterministic models is on the model variables. Models that are based on
one or more variables that are random in nature are referred to as stochastic models. These models produce
output that is itself random and therefore only an estimate of the true behaviour of the model. The model for the
investigation uses operation times which are probabilistic hence it is a stochastic model.
Deterministic models are those that have no input components that are random. In this model the behaviour of
the model is determined once the input data has been defined.

1.3.4 Static or Dynamic


Models are classified as either static or dynamic depending on whether or not the model variables change over
time. In this study the aim is to study the effect of loading on the performance of MRP system, this implies a
variation of loading (queue length) as model execution progresses. The model is therefore dynamic.

1.3.5 Open Loop or Closed Loop


The notion of an open loop or closed loop model is defined by the structure of the model rather than by the
variables. Open loop models have no provision for the output of the model to fed back as inputs to modify
subsequent outputs. A closed loop model is one in which output fed back and compared with some desired level
or goal to alter the system such that it remains the desired value.

1.4 Steps in a Simulation Study


1.4.1 Problem Formulation
Every study should begin with a statement of the problem. If the statement is provided by the policy makers or
those that have the problem, the analyst must ensure that the problem being described is clearly understood. If a
problem statement is being developed by the analyst, it is important that the policy makers understand and agree
with the formulation. In many instances policy makers and analysts are aware that there is a problem long
before the nature of the problem is known.
1.4.2 Setting of Objectives and Overall Project Plant.
The objectives indicate the questions to be answered by simulation. At this point, a determination should be
made concerning whether simulation is the appropriate methodology for the problem as formulated and
objectives as stated. Assuming that it is decided that simulation is appropriate, the overall project plant should
include a statement of the alternative systems to be considered and a method for evaluating the effectiveness of
these alternatives. It should also include the plans for the study in terms of the number of people involved and
the cost of the study and the number of days required to accomplish each phase of the work with the anticipated
results at the end of each stage.

1.4.3 Model Conceptualization


Construction of the model of a system which involves ability to abstract the essential features of a problem, to
select and modify basic assumptions that characterize the system and then to enrich and elaborate the model
until a useful approximation results. It is not necessary to have a one-to-one mapping between the model and
the real system. Only the essence of the real system is needed. Involvement of model users is advisable at this
stage to enhance quality of resulting model and increase confidence in application of model by user.

1.4.4 Data Collection


There is a constant interplay between the construction of the model and collection of the needed input data.
This may take a lot of time thus it is necessary to begin early as possible.

1.4.5 Model translation


Entering model into computer recognizable format. The modeler must decide whether to program the model in
a simulation language such as GPSS/H, SIMAN V, SIMSCRIPT II. 5 or SLAM SYSTEM or using special
purpose simulation software (ARENA, WITNESS, PRO-Model, Auto Mod. Simulation languages are usually
more powerful and more flexible than the special-purpose software which on the other hand reduce development
time.

1.4.6 Verification
Pertains to the computer program prepared for the simulation model whether it is performing properly. This is
through checking of input parameter and logical structure of the model through a number of iterative debugging.

1.4.7 Validation
Determination whether model is accurate representation of a real system. This can be done through calibration
of the model, and iterative process of comparing the model to actual system behaviour and using the
discrepancies between the two and the insights gained to improve the model.

1.4.8 Experimental Design


Alternatives that are to be simulated must be determined as a of this to be completed and analyzed. For each
system design that is simulated decisions need to be made concerning the length of the initialization period, the
length, and the number of replications to be made of each run.

1.4.9 Production Runs and Analysis


Used to estimate measures of performance of the system design

1.4.10 More Runs?


Based on the analysis of the runs that have been completed, the analyst determines if additional runs are needed
and what design those additional experiments should follow.

1.4.11 Documentation and Reporting


It is necessary to understand how the program operates which enhances confidence in the program so model
users and policy makers can make decisions based on the analysis. The other reason for documenting a model is
so that model user can change parameters of the model at will in an effort to determine the relationship between
input parameters and output measures of performance.

1.4.12 Implementation
1.4.1 Problem Formulation
 Identify decisions and uncontrollable variables
 specify constraints on the decision variables
 define measures of system performance
 develop a preliminary model structure to interrelate the system variables and the measures of
performance

1.5 Process of Making Decisions


Simulation is a tool to assist the making decision making process.

A number of different approaches exist in making decisions.


 Intuitive
 Analytical
 Experimental

1.5.1 Intuitive
The intuitive approach is often used when little time is available and where non-critical decisions are
being considered.
 Decision based on past experience.
 Can often be difficulty as the size and level of complexity in the system increases. The factors
affecting systems involve:
 Complex interactions (many conditions)
 Uncertainty
 Conflicting objectives;
 customer satisfaction
 efficient utilisation
 reduction in WIP
 Diffusion of authority, and differing priorities
 Technology
 Can lead to expensive mistakes being made

MUST TACKLE THE CAUSE NOT THE SYMPTOM.

1.5.2 Analytical
Where time and understanding allows a scientific analysis can sometimes be justified. This often the case when
cost of a mistake is high. Precise mathematical formulation is required.

Possible techniques include:


 Queuing Theory
 Linear Programming

HOWEVER, quite often the process of the model (mathematical) formulation is unfeasible, even if a model can
be made, solution techniques may not be sufficiently developed.

BECAUSE , Assumptions have to be made and these tend to be unrealistic. The solutions therefore are
perceived to be of little practical use.

1.5.3 Experimental
Experimentation on the real system is
 Impractical -we need to be able to control the experiment, but it is very difficult to do this on the
shop floor. Time scales are inadequate, an experiment might take months to complete
 Expensive -One cannot purchase equipment simply on the wish to evaluate whether it is needed or
not. One cannot hire labour without training them and paying them, and this is expensive if they are
subsequently found not to be required.
 Disruptive -A company must still satisfy existing customers and can only do this by continuing to
operate normally. This is difficult if resources are taken away to perform an experiment, or if
layouts are re-organised during normal working hours. Changes to work patterns and tasks are
disruptive, both operationally and in terms of their effect on morale

1.6 We Need A Model Of Real System


The ‗Simulation‘ approach is an experimental approach. It allows the user to conduct TRIAL & ERROR
experiments

In order to conduct a simulation requires the use of a MODEL: A logical representation (on a computer) of the
operation of the system and the uncertainty to which it is subjected.

REAL EXECUTIVE
WORLD PROGRAM

Modelling Simulation

MODEL

1.7 Operations
 Activities:
 Start Cycle
 Conditions
 In working order
 Machine idle
 Set-up for job
 States
 Machine busy (change as a result of start cycle)
 Duration
 Time
 Change of State at end
 Machine idle

NOTE: IT IS THE RESOURCE THAT LINK THE ACTIVITIES IN A SYSTEM

1.8 Uncertainty
Uncertainty is evident in many of the operations of a manufacturing system.

Uncertainty is a major cause of poor performance.

Factors involving uncertainty


 Labour absenteeism
 Demand pattern for products
 Machine availability
 Process variation

Any good simulation system should support the user by providing a means of representing uncertainty. In most
cases this is achieved by sampling from statistical distributions

1.9 Sampling
Sampling is the method by which a random selection of values representing the expected pattern of a variable
can be made.

The distribution most often used are


 NORMAL
 NEGATIVE EXPONENTIAL
 UNIFORM

1.10 Benefits Of The Simulation Approach


 Better utilisation of resources
 Feasibility studies can be carried out
 Improved understanding of the system behaviour
 Confidence in decisions taken
 Improved communication of objectives and constraints
 Training tool

1.11 When is Simulation the Appropriate Tool?


1. Simulation enables the study of, and experimentation with, the internal interactions of a complex system, or of
a subsystem within a complex system.
2. Informational, organizational and environmental changes can be simulated and the effect of these alterations on
the model's behaviour can be observed.
3. The knowledge gained in designing a simulation model may be of great value toward suggesting improvement
in the system under investigation.
4. By changing simulation inputs and observing the resulting outputs, valuable insight may be obtained into
which variables are most important and how variables interact.
5. Simulation can be used as a pedagogical device to reinforce analytic solution methodologies.
6. Simulation can be used to experiment with new designs or policies 'prior to implementation, so as to
prepare for what may happen.
7. Simulation can be used to verify analytic solutions.

 BEFORE THE INSTALLATION OF A SYSTEM


 AFTER THE INSTALLATION OF A SYSTEM
 Identifying bottlenecks and improving performance
 Guidance on actions to be taken under changed circumstances
 Operational Planning

To be successful it needs:-
 User commitment
 Free interaction between user and expert (if any)
 Availability of accurate data
 An understanding of how individual elements of the system behave

1.12 Advantages of Simulation


1. New policies, operating procedures, decision rules, information flows, organizational procedures, and
so on can be explored without disrupting ongoing operations of the real system.
2. New hardware designs, physical layouts, transportation systems, and so on, can be tested without
committing resources for their acquisition.
3. Hypotheses about how or why certain phenomena occur can be tested for feasibility.
4. Time can be compressed or expanded allowing for a speed up or slow down of the phenomena under
investigation.
5. Insight can be obtained about the interaction of variables.
6. Insight can be obtained about the importance of variables on the performance of the system.
7. Bottleneck analysis can be performed indicating where work in process, information, materials, and so on
are being excessively delayed.
8. A simulation study can help in understanding how the system operates rather than how individuals think
the system operates.
9. "What if questions can be answered. This is particularly useful in the design of new systems.

1.13 Disadvantages of Simulation


1. Model building requires special training. It is an art that is learned over time and through experience.
Furthermore, if two models are constructed by two competent individuals, they may have similarities,
but it is highly unlikely that they will be the same.
2. Simulation results may be difficult to interpret. Since most simulation outputs are .essentially random
variables (they are usually based on random inputs), it may be hard to determine whether an observation
is a result of system interrelationships or randomness.
3. Simulation modelling and analysis can be time consuming and expensive. Skimping on resources for
modelling and analysis may result in a simulation model or analysis that is not sufficient for the task.
4. Simulation is used in some cases when an analytical solution is possible, or even preferable. This is
particularly true in the simulation of some waiting lines where closed-form queueing models are
available.

1.14 Areas of Application


Manufacturing systems
Material handling system design for semiconductor Interoperability for spares inventor) planning
manufacturing
Aircraft assembly operations Agile control of aerospace manufacturing
Spatial representation and autonomy in material Distributed model for computer integrated
handling systems manufacturing
Agent-based flexible routing manufacturing control Tool shared flexible manufacturing system
system
Rapid manufacturing Order release planning in a job shop
Finite capacity scheduling system Inventory cost model for 'just-in-time' production
Inventory tracking of a Kanban production system Strain of manual work in manufacturing systems
Traditional versus activity-based costing in product
mix decisions '

Public systems

Health care
Prediction of pharmaceutical costs and outcomes Cementless hip replacement
Reducing the length of stay in emergency
departments

Military
Issues in operational lest and evaluation Army officer professional development
Successful process for military base transition Future theater-level model
Theater air command and control Marine air-ground task force tactical warfare
Combat modelling-in medium lift replacement cost Corps battle simulation
and effectiveness analysis

Natural resources
Solid waste management system Tank waste remediation system
Operational efficiency at a nuclear power plant Environmental restoration activities
Oil spill modelling
Transportation systems
Cargo transfer and personnel launch system Container port operations
Demand based toll plaza lane staffing

Construction systems
Applications in earthmoving/strip mining Cable- Strengthening the design/construction interface
staved bridges Advanced project planning paradigm

Restaurant and entertainment systems


Quick service restaurant traffic analysis Determination of labour requirements
Opportunities in amusement parks
Business process reengineering
Integrating business process reengineering with image- Business process modelling and analysis tool
based work flow
Food processing
Trawler operations in the fish processing industry Capacity expansion for the pistachio hulling process
Evaluating international competitiveness in broiler
production
Computer system performance
Heterogeneous networks Evaluating large-scale computer system performance
Client/server system architecture

2.0 Modelling And Simulation Basics

2.1 THE OBJECTS OF A SYSTEM


System- is a group of objects that are joined together in some regular interaction or interdependence toward the
accomplishment of some purpose e.g. production system manufacturing automobiles (machines, components
parts and workers operate jointly along an assembly line to produce a high-quality vehicle)

2.1.1 ENTITIES
These are the elements of the system being simulated and can be individually identified and processed
 Machines in a factory
 Jobs waiting to be processed
 Vehicles
 People
 or ANYTHING else that changes STATE as a simulated system proceeds

Entities can be classified into types:


 PERMANENT entities - These remain in the system throughout the simulation, eg.
Machines, Conveyors…
 TEMPORARY entities - These pass through the system and once they leave, cease to be
of interest e.g. Parts

Entities can also be classified according to the way they behave:-


 PASSIVE entities are those that can be processed by others
 ACTIVE entities are those that carry out processing, usually on the passive entities

2.1.2 CLASSES
By grouping like entities into a CLASS, several or all of the entities can be referred to in a simple and
easy way
e.g. Car bodies in a Paint Shop, a CLASS ―BODY‖ could be created that groups 3, 4 and 5 door types.
2.1.3 ATTRIBUTES
Attributes are used to describe an entity in greater detail, to convey some specific information about it
or is a property of an entity
e.g. The Class ―Body‖ may have an ATTRIBUTE called ―Doors‖ which describes whether it has 3, 4
or 5 doors.
Attributes may be used for many varied purposes:
 Determining a queue position based on some queuing discipline ie. FIFO, LIFO, Sorted
 Specifying a priority
 Controlling the behaviour of an object e.g. the payload of an aircraft may affect the size of runway
that it can use

2.1.4 SETS
Sets can represent a classification of STATES that an entity(s) may pass through
e.g. Car bodies leaving a Paint Shop may either
Bad paint (needing rectification)
or Good (ready for next operation)
These two States can be represented as sets and these sets can contain a dynamic quantity of entities
Often sets can be thought of as QUEUES

A REAL LIFE SYSTEM CAN BE REPRESENTED IN A SIMULATION MODEL THROUGH THE


CHANGE OF STATE OF ITS ENTITIES

SUCH STATES CAN BE EITHER ACTIVE OR IDLE (PASSIVE)

2.1.5 ACTIVITY (ACTIVE STATE)


Represents a time period of specified length or the State in an entity(s) remains some specified
operation takes place. (The duration of such a state is DETERMINATE)

2.1.6 QUEUE (IDLE OR PASSIVE STATE)


The state in which a entity(s) is waiting to start some ACTIVITY. (The duration of such a state is
INDETERMINATE)
From the above definitions we can see that:
ENTITIES PROGRESS IN A SIMULATION THROUGH A SUCESSION OF ACTIVE AND PASSIVE
STATES

OR: THROUGH A SEQUENCE OF ACTIVITIES AND QUEUES

As the simulation proceeds, the entities co-operate and change state. The following terminology is used to
describe these operations and the flow of time in the simulation.

2.1.7 EVENT
An INSTANT in time when a change of state takes place of one or more entities. e.g. Machine finishes
cycle, part enters buffer

2.1.8 PROCESS
A sequence of events through which an entity passes, usually in chronological order. A process can
represent all or some of the LIFE CYCLE of an entity (usually a temporary entity)

2.1.9 SIMUALTION CLOCK. (“The Clock”)


This is the value of simulated time

• System
– A collection of entities (eg people and machines) that interact together over time to
accomplish one or more goals
• Model
– An abstract representation of a system, usually containing structural, logical or mathematical
relationships which describe a system in terms of state, entities and their attributes, sets,
processed, events, activities, and delays
• System State
– A collection of variables that contain all the information necessary to describe the system at
any time
• Entity
– Any object or component in the system which requires explicit representation in the model (
eg server, a customer, a machine)
• Attributes
– The properties of a given entity (eg priority of a waiting customer, routing of a job through a
job shop)
• List
– A collection of (permanent or temporarily) associated entities, ordered in some logical fashion
(such as all customers currently in a waiting line, ordered by first come, first served or by
priority)
• Event
– An instantaneous occurrence that changes the state of a system ( such as an arrival of a new
customer)
• Event Notice
– A record of an event to occur at the current or some future time along with any associated data
necessary to execute the event; at a minimum, record includes the event type and event time
• Event list
– A list of event notices for future events, ordered by time of occurrence; also known as the
future event list (FEL)
• Activity
– A duration of time of specified length (eg service time, or interarrival time) which is known
when it begins (although it may be defined in terms of a statistical distribution)
• Delay
– A duration of time of unspecified indefinite length, which is not known until it ends (eg a
customers‘s delay in a last in, first out waiting line which, when it begins depend on future
arrivals)
• Clock
– A variable representing simulated time called CLOCK

2.2 THE LIFE CYCLE OF AN ENTITY.


The complete sequence of state an entity passes through during the course of a simulation
e.g. A coffee drinker entity
Drink coffee
Wait for refill
Drink coffee
Wait for refill
etc.

A waiter:
Fill cup
Wait for empty cup
Fill cup
Wait for empty cup
etc.

A Cup:
? -
What classes of entity are these?
The life cycle can be represented graphically using a directed network diagram

LIFE CYCLE DIAGRAM

2.3 A COMMON SENSE APPROACH TO MODELLING

In all but the simplest of situations the complexity and scale of the interactions that may take place between
entities (the sequence of activities and queues through which they pass) requires the modeller to formalise the
process of model specification.

Three stages of modelling can be identified:

Identify entities

Identify each entity‘s life cycle

Identify the interactions between the entity life cycles.

The most natural view of a system is that based on the ACTIVITIES that take place in the system. The Activity
cycle diagram is one method that has been developed for formalising the process of model specification.

2.4 THE ACTIVITY CYCLE DIAGRAM.

The activity cycle diagram (ACD) is formed from the combination of individual life cycle diagrams. The details
of combination represent the logic of entity interaction.

2.4.1 RULES & CONVENTIONS IN ACDs.


 Queues and Activities must alternate.
 The diagram must be closed loop
 Queues are represented diagrammatically by circles.
 Activities are represented diagrammatically by rectangles.
 The direction of the life cycle sequence is represented with a directed arrow.

2.5 DIFFERENT APPROACHES TO SIMULATION.

2.5.1 TIME ADVANCE.

The SIMULATION CLOCK maybe moved forward in two ways:


2.5.1.1 FIXED INCREMENT
 Time is moved forward in fixed steps or ‗slices‘.
 At each slice, all relationships in the system are evaluated and used to update the
simulation status.
 This is a characteristic method for dealing with non-discrete event systems, or
CONTINUOUS SYSTEMS, such as in missile dynamics.

2.5.1.2 VARIABLE INCREMENT


 Time is advanced under the control of some EXECUTIVE PROGRAM to the
earliest possible event due to occur.
 Only the relevant events occurring at this time are evaluated and the simulation
status updated.
 This is a characteristic method for dealing with DISCRETE EVENT SYSTEMS
such as manufacturing systems.

2.5.2 THE “WORLD VIEWS”


There are 4 distinct approaches (―World Views‖) to the simulation of discrete event systems, these are:-

2.5.2.1 ACTIVITY BASED


Modelling is centred on the description of activities. Each activity describes the
conditions under which it becomes active and the change of state that occurs when
this happens.

2.5.2.2 EVENT BASED


The complete model is described as a set of event descriptions, each describing the
state change associated with a particular event (often the event that occurs at the end
of an activity). Two types of event: Scheduled (time-dependent) events and
consequential (state dependent) events.

2.5.2.3 PROCESS BASED (“Process Interaction”).


This is a combination of activity and event based approaches and is particularly easy
to apply when considering batch type environments. It is common in the United
States.

A fourth approach, THE THREE PHASE APPROACH developed by Toacher (1963) also combines activity
and event based methods. It is more common in the United Kingdom.

2.5.2.4 THE THREE PHASE APPROACH

This is a description of the algorithm which forms the basis of the executive program or ―Executive‖
for short.

START PHASE For each activity in turn test to see if it can start. If it can, move all
participating entities from their respective queues into the activity and determine the time it
will end. This is known as the Conditional or activity can start. Testing is needed because the
activation time cannot be predicted in advance; the time spent in a queue is indeterminate.

TIME PHASE Advance the Simulation Clock time to the earliest activity end time. This is
known as the ‗A‘ phase.

END PHASE End all activities due to end at the current simulation Clock time and send
all participating entities to their destination queues. This is also known as the Bound or ‗B‘
phase, because these activities are bound to end at this time. The activities had determinate
duration.

3.0 MODELLING

3.1 THE ACTIVITY CYCLE DIAGRAM


The activity cycle diagram (ACD) is formed from the combination of individual life cycle diagrams. The details
of combination represent the logic of entity interaction.

3.1.1 RULES & CONVENTIONS IN ACDs.

 Queues and Activities must Alternate


 The diagram must be closed loop
 Queues are represented diagrammatically by circles.
 Activities are represented diagrammatically by rectangles.
 The direction of the life cycle sequence is represented with a directed arrow.

3.2 Problem 1
There are three machines and one mechanic. When any one of the machines is broken down it is repaired by the
mechanic. After repair the machine runs until it breaks down again.

The company involved, wants to determine the average waiting time of the machine before it is repaired and the
percentage of time the mechanic is idle. The objective of such an exercise may be to determine if the mechanic
could be put in charge of a fourth machine (or conversely there is a need for a second mechanic)

Specify a model using an activity cycle diagram.

3.3 PROBLEM 2

As an extension to the previous machine maintenance problem (Problem 1), suppose that the repair of a machine
can be broken down into the following activities:-

-An electrician disconnects the supply.


-A sub-contractor removes/re-sites the machine.
-A fitter repairs the machine.

There is one mechanic, one fitter and three persons in the sub-contracting team.

(i) Draw the Activity Cycle diagram for this system.


(ii) The following priority rules are applied:-
-Reconnection of the electricity supply has priority over disconnection.
-Re-siting a machine is more important than removal.
How can these priorities be reglected in the Activity cycle diagram?
(iii) There is a shortage of floor space and only two machines can be removed from their mountings at any
one time.
How can this be represented on the Activity Cycle Diagram?

3.4 IMPLEMENTATION ON A COMPUTER

The Activity Cycle Diagram (ACD) is one formalism for representing the logic of entity interaction in a discrete
event system. It in effective when the system comprises alternating queues and activities. The ACD cannot be
directly implemented in a computer model without the addition of a World Set; this provides a reusable pool of
entities (memory locations) that prevents the gradual exhaustion of computer resource that would otherwise
occur.
THE OUTSIDE WORLD (World queue or World Set)
The Outside World is a conceptual idea that allows us to restrict the scope or boundaries of a model. By doing
so it provides a means of dealing with the problem of allowing a model to run for very long periods of simulated
time.

The Outside World provides a (limited) source of temporary entities.

When the simulation system has finished with a temporary entity it returns it to the Outside World so that it can
be reused.

We can incorporate the Outside World as a Queue in the ACD. This is an acceptable approach as by definition
we cannot predict when external (exogenous) events will occur. Note: We do however, usually ally the world
set with an arrival mechanism that stimulates entities to enter a model under programmer‘s control.

3.5 MODELLING ARRIVALS FROM THE OUTSIDE WORLD

There is a potential problem when modelling entity arrival from the Outside world; the computer can become
trapped in a ‗loop‘.

The World Set may contain many thousands or millions (with increasing RAM and disk space on modern
computers) of as yet unused entities that may enter a model. A naive modeller could quite easily be led to build
an ACD that allowed all of these entities to enter a model at time zero:

This problem can be prevented by the use of a dummy resource in two ways depending onthe availability of
material and whether we are modelling a PUSH or PULL system:

3.6 BENEFITS OF THE ACTIVITY CYCLE DIAGRAM


 The logic of the system operation is clearly represented.
 It provides a focus for discussion and understanding.
 All the entities are identified.
 The interactions between entities is explicitly stated.
 The inputs and outputs of the system can be identified.
 The logic of the model is documented for future reference
 The model can be maintained, it can be developed
 It helps control the development for complex models.

Problem 1
M a ch ni e

R un

W a it W a it
R e p a ir

R e p a ir

M e ch a n ic

R e p a ir

Id el

4.0 SIMULATION AND EXPERIMENTATION

4.1 THE THREE PHASE APPROACH

This is a description of the algorithm which forms the basis of the executive program or ―Executive‖ for short.

START PHASE For each activity in turn test to see if it can start. If it can, move all participating entities from
their respective queues into the activity and determine the time it will end. This is known as the Conditional or
‗C‘ phase, because it involves a test to see if an activity can start. Testing is needed because the activation time
cannot be predicted in advance; the time spent in a queue is in determinate.

TIME PHASE Advance the simulation clock time to the earliest activity end time. This is known as the ‗A‘
phase.

END PHASE End all activities due to end at the current Simulation Clock time and send all participating
entities to their destination queues. This is also known as the Bound or ‗B‘ phase, because these activities are
bound to end at this time. The activities had determinate duration.
4.2 SAMPLING
Many systems behave stochastically (governed by probability) and must therefore before simulated by a model
with stochastic elements.

4.2.1 PROBABILITY DISTRIBUTIONS.

To illustrate the concept of a probability distribution, consider the historical data relating to the breakdown of a
particular machine.
Days since last Number of Prob. Of Cumulative failure
repaired
Days since last observations
Number of failure
Prob. Of probabilities
Cumulativefailure
Cumulative
Days
repaired since Number of Prob. Of failure
1 observations 5 failure 0.05 probabilities 0.05
last repaired 1 2 observations15
5 failure 0.15 probabilities 0.05
0.05 0.2
1 3
2 5 20
15 0.050.15
0.2 0.05 0.4
0.2
2 4
3 15 20 30 0.3
0.15 0.2 0.2 0.7
0.4
3 5
4 20 30 20 0.2
0.2 0.3 0.4 0.9
0.7
4 6
5 30 10
20 0.3 0.1
0.2 0.7 0.91
>6 5 6 20 10 0 0.2 0.10 0.9 11
>6 6 10 0 0.1 0 1 1
>6 0 0 1
Histogram of failure probabilities
Histogram of failure probabilities
0.35
0.35
0.3
0.3
0.25
0.25
0.2
0.2
0.15
0.15
0.1
0.1
0.05
0.05
0
0 1 2 3 4 5 6 >6
1 2 3 days
4 5 6 >6
days

Histogram of cumulative failure probabilities


Histogram of cumulative failure probabilities
1.2
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
1 2 3 4 5 6 >6
0
1 2 3 days since
4 repair 5 6 >6
days since repair
For the purpose of sampling, the individual failure probabilities need to be accumulated into a cumulative
probability distribution -an illustrative example using histogram is used here.

4.2.2 RANDOM SAMPLING


There are two requirements for random sampling in discrete event simulation.
 A sequence of random numbers inthe range 0 to 1. “Random Number Stream”
 A method of converting these into samples from an appropriate distribution.

4.2.3 RANDOM NUMBER GENERATION

True random number streams cannot be generated by a computer, however a aproximate method can be
employed.

The computer implementation of random number is achieved using a PSEUDO RANDOM NUMBER
GENERATOR.

In simulation we need to be able to providemore than one steam of random numbers, each stream representing
an independant stochastic element.

This is achieved by providing the pseudo random number generator with a‖SEED‖.

Eg. RANDOM(N) where N=1..99 say

RANDOM(1) => .22, .45, .9, .03, .45, .37, .81, .31.......

RANDOM(2) => .77, .65, .45, .22, .02, .88, .47, .29........

Because the generator is a mathematical algorithm, each time we tell the computer to use RANDOM(1) say, it
will return the same stream of numbers.

4.2.4 RANDOM SAMPLING ON A COMPUTER

By generating random numbers on the computer we can apply these to a probability distribution to return the
expected observed values:
The samples.
Using the previous example, if we use N=2, the computer will return the following values:
.77,.65,.45,.22,.02,.88,.47,.29
The first value .77 falls within the range 0.70 to 0.899 on the cumulative probability histogram for the machine.
This corresponds to a failure interval of 5 days. We can use this to schedule a machine breakdown using the
three phase approach.

The next time we sample from this distribution we get:


random number = .65 corresponding to range 0.40 to 0.699
=> 4 days between failures.

IF WE HAVE TWO INDEPENDENT MACHINES, THEN USING TWO DIFFERENT STREAMS WILL
PROVIDE US WITH INDEPENDENT FAILURE RATES FOR EACH.

THIS CORRESPONDS TO THE NORMAL CASE IN INDUSTRY.

4.4 Problem 3

Jobs arrive at random into an FMS cell. From the arrival station the component is picked up by a robot and put
onto a palletisation station where a setter palletises it. Each job then goes through processes on two different
machines -the robot again moving the component between them. At the end of the second operation, the robot
places the component onto an exit station from which it is taken off the pallet by one of the setters and taken to
an assembly area outside the cell.
Draw the activity cycle diagram for the cell.

4.5 Record Sheet

Clock Phase Timers

Time

Entity 1 Entity 2 Entity 3 Entity 4


A B C on off dur on off dur on off dur on of
f

4.6 Scan List- Activities in progress

Activity No. Finishing Time

5.0.0 Hand Simulation of Queuing Systems


For each repetition I generate a value for each of the p inputs and evaluate the function, calculating a value of
the response yi. This step is accomplished by sampling values from the distributions determined in step 1

Table 5.1 Simulation Table


Repetitions Inputs Response
x1 x12 xij yI
1
2
3
4
5
6

5.2.1 Simulation of Queuing Systems

A queuing system is described by its calling population, the nature of the arrivals and services, the system
capacity and the queueing discipline.

Calling Server
Population

Waiting line

Figure 5.2: Queuing system

In this system the calling population is infinite i.e. if a unit leaves the calling population and joins the waiting
line or enters service there is no change in the arrival rate of other units that may need service. In this, system
arrivals for service occur one at a time in a random fashion and once they join the waiting line, they are
eventually served. In addition, service times are of some random length according to a probability distribution,
which does not change overtime. In addition, the system capacity is unlimited. Callers are served in the order
of their arrival (FIFO) by a single server or channel.
Arrivals and services are described by the distributions of time between arrivals and service times. The overall
effective arrival rate must be less than the maximum service rate or the waiting line will grow without bound.

The state of the system is the number of units in the system and the status of the server, busy or idle.

An event is a set of circumstances that causes an instantaneous change in the state of the system. In a single-
channel queueing system, there are only two possible events that can affect the state of the system. They are the
entry of a unit into the system (the arrival event) or the completion of service on a unit (the departure event).
The queuing system includes the server, the unit being serviced and units in the queue.

If service has just been completed, the simulation proceeds in the manner shown in the flow diagram of Figure
5.3. Note that the server has only two possible conditions. It is either busy or idle.

Departure
Event

No another Yes
Begin server idle Remove the
Unit waiting
time waiting unit from
queue
Begin servicing the
nut
Figure 5.3: Service just completed flow diagram.
Second event occurs where a unit enters system as illustrated by Figure 5.4

Arrival
event

No Server Yes
busy

Unit enters Unit enters queue


Service For service

Figure 5.4: Unit entering system flow diagram

Queue Status
Not empty Empty
Server Busy Enter queue Enter queue
Outcomes Idle Impossible Enter service
Figure5.5 potential into actions upon arrival

Queue Status
Not empty Empty
Server Busy Enter queue
Outcomes Idle Impossible
Figure 5.6: Server outcomes after service completion

The next step is maintaining of event list which indicates the times at which the different types of events occur
for each unit in the queuing system. The times are kept on a ―clock‖ which marks the occurrences of events in
time. In simulation, the events usually occur at random. The randomness imitates real life to portray
uncertainty.
The randomness needed to imitate real life is made possible using ―random numbers‖ Random numbers are
distributed uniformly and independently on the interval (0,1). Random digits are uniformly distributed onto the
set {0,1,2 ---,9). Random digits can be used to form random numbers by selecting the proper number of digits
for each random number and placing a decimal point to the left of the value selected. The proper number of
digits is dictated by the accuracy of the data being used for input purposes. If the input distribution has values
with two decimal places, two digits are taken from a random digits table (Table A.1) and the decimal point is
placed to the left to form a random number.

Random numbers can also be generated using a set procedure and this is referred to as pseudo-random numbers.

Table 5.2 contains a set of five inter-arrival times generated from rolling a die five times and recording the up
face. These are used to compute the arrival times of six customers at the queuing system.

Table 5.2: Interarrival and clock times.


Customer Interarrival Time Arrival Time on Clock
1 - 0
2 2 2
3 4 6
4 1 7
5 2 9
6 6 15

Service times are generated assuming that the service times are in the range {1…4} This can be done by
placing chips and picking with replacement in a hat while recording the numbers selected.

Table 5.3: Service Time


Customer Service Time
1 2
2 1
3 3
4 2
5 1
6 4

Table 5.4: Simulation table emphasizing clock time


Customer Arrival Time Time Service Service Time Time Service
Number (clock) Begins(clock) (Duration) Ends (Clock)
1 0 0 2 2
2 2 2 1 3
3 6 6 3 9
4 7 9 2 11
5 9 11 1 12
6 15 15 4 19
Table 5.5 Chronological Ordering of Events
Event type Customer Number Clock Time
Arr. 1 0
Dep. 1 2
Arr 2 2
Dep 2 3
Arr 3 6
Dep 4 7
Arr 3 9
Dep 5 9
Arr 4 11
Dep 5 12
Arr 6 15
Dep 6 19

Number of
customer in
the system
2
4 5

1
1 2 3 4 5 6

Clock Time
Figure 5.6 depicts the number of customers in the system at the various clock times

Example 5.1: Single – Channel Queue


A small grocery store has only one checkout counter. Customers arrive at this checkout counter at random from
1 to 8 minutes apart. Each possible value of inter arrival time has the same probability of occurrence.

Table 5.6: Distribution of time between Arrivals


Time between Probability Cumulative Random Digit
Arrivals (min) Probability Assignment
1 0.125 0.125 001-125
2 0.125 0.250 126-250
3 0.125 0.375 251-375
4 0.125 0.500 376-500
5 0.125 0.625 501-625
6 0.125 0.750 626-750
7 0.125 0.875 751-875
8 0.125 1.000 876-000

The service times vary from 1 to 6 min with the probabilities shown in Table 5.7
Table 5.7: Service – Time Distribution
Time between Probability Cumulative Random Digit
Arrivals (min) Probability Assignment
1 0.10 0.10 01-10
2 0.20 0.30 11-30
3 0.30 0.60 31-60
4 0.25 0.85 61-85
5 0.10 0.95 86-95
6 0.05 1.00 96-00

The problem is to analyze the system by simulating the arrival and service of 20 customers. In actuality 20
customers is too small a run length to draw any final conclusion. The accuracy of results is enhanced by
increasing the sample size. The other issue is that of initial conditions. A simulation of a grocery store that
starts with an empty system is not realistic unless the intention is to model the system from startup or to model
until steady-state operation is reached.

Random digits are converted to random number by placing the decimal at the appropriate point. In this case,
three-place random numbers will suffice. It is only necessary to list 19 random numbers to generate times
between arrivals because the first arrival is assumed to occur at time 0.

Considering Table 5.6, The first random digit assignment is 001-125. There are 1000 three-digit values
possible (001 through 000). The probability of a time- between-arrival of 1 minute is 0.125 and 125 of the 1000
random digit values are assigned to such an occurrence. Three digits are needed since the probability
distribution is described with three – digit accuracy. Time between arrival for 19 customers are generated by
listing 19 three-digit values from Table A.1 and comparing them to the random digit assignment of Table 5.6

Table 5.8: Time-between-arrival determination


Customer Random Time between Customer Random Time between
Digits Arrivals (minutes) Digits arrivals (minutes)
1 - - 11 109 1
2 913 8 12 093 1
3 727 6 13 607 5
4 015 1 14 738 6
5 948 8 15 359 3
6 309 3 16 888 8
7 922 8 17 106 1
8 753 7 18 212 2
9 235 2 19 493 4
10 302 3 20 535 5

Note the first random digits are 913. To obtain the corresponding time between arrivals, either the fourth
column of Table 5.6 and read 8 minutes from the first column of the table.

Table 5.9: Service Times Generated


Customer Random Service Time Customer Random Service
Digits (minutes) Digits Time(minutes)
1 84 4 11 32 3
2 10 1 12 94 5
3 74 4 13 79 4
4 53 3 14 05 1
5 17 2 15 79 5
6 79 4 16 84 4
7 91 5 17 52 3
8 67 4 18 55 3
9 89 5 19 30 2
10 38 3 20 50 3
The essence of a manual simulation is the simulation table. These tables are designed for the situation at hand
and further structured to answer the questions posed.

Some of the findings are

1) The average waiting time for a customer


= Total time customer waits in queue (min)
Total number of customer
56
=  2.8 min
20
2) The probability that a customer has to wait in the queue
Probability (wait) = Number of customer who wait
Total number of customers
13
 0.65
20
Customer Time Since Arrival Service Time Time Time Time Customer Idle Time of
Last Time Time Service Customer Service Spends in server (min)
Arrival (min) begins waits in Ends System (min)
(min) queue (min)
1 - 0 4 0 0 4 4 0
2 8 8 1 8 0 9 1 4
3 6 14 4 14 0 18 4 5
4 1 15 3 18 3 21 6 0
5 8 23 2 23 0 25 2 2
6 3 26 4 26 0 30 4 1
7 8 34 5 34 0 39 5 4
8 7 41 4 41 0 45 4 2
9 2 43 5 45 2 50 7 0
10 3 46 3 50 4 53 7 0
11 1 47 3 53 6 56 9 0
12 1 48 5 56 8 61 13 0
13 5 53 4 61 8 65 12 0
14 6 59 1 65 6 66 7 0
15 3 62 5 66 4 71 9 0
16 8 70 4 71 1 75 5 0
17 1 71 3 75 4 78 7 0
18 2 73 3 78 5 81 8 0
19 4 77 2 81 4 83 6 0
20 5 82 3 83 1 86 4 0
68 56 124 18

3) The proportion of idle time of the server


Probability of idle server = Total run time of server (idle) (min)
Total run time of simulation (min)
18
=  0.21
86

The probability of the server being busy is the complement of 0.21 or 0.79

4) The average service time is 3.4 minutes


Average service time = Total service time (minutes)
Total number of customers
68
=  3.4 minutes
20
This result can be compared with the expected service time by finding the mean of the service time distribution
using the equation.

E ( S )   sp( s)
s o
Applying the expected value equation to the distribution gives:
Expected service time = 1(0.10)+2(0.20)+3(0.30)+4(0.25)+5(0.10)+6(0.05)

The expected service time is slightly lower than the average service time in the simulation. The longer the
simulation the closer the average will be to E(S).

5) The average time between arrivals is 4.3 minutes

Average time between arrivals (minutes) = Sum of all times btwn arrivals (min)
Number of arrivals – 1
82
=  4.3 min
19
One is subtracted from the denominator because the first arrival is assumed to occur at time ). This result can be
compared tot he expected time between arrivals by finding the mear of the discrete uniform distribution whose
a  b 1 8
end points are a=1 and b=8. The mear is given by E(A)=   4.5 min
2 2
The expected time between arrivals is slightly higher than the average. In a large simulation the average value
of the time between arrivals should approach the theoretical E(A)

6) The average waiting time of those who wait is 4.3 min


Average waiting time of = Total time customers wait in queue (min)
Total number of customers
56
=  4.3 min
13
7) The average time a customer spends in the system is 6.2min

Average time Customer = Total time customers wait in queue (min)


Total number of customers
124
=  6.2 min
20
Average time Customer Average time Customer Average time Customer
Spends in the System = spends waiting in Queue + spends in service (min)
(min) (min)
= 2.8+3.4
= 6.2 min

A decision-maker would be interested in results of this type but a longer simulation increases the accuracy of the
findings. However, some subjective inferences can be drawn. Most customers have to wait; however, the
average waiting time is not excessive. The server does not have an undue amount of idle time. Objective
statements about the results would depend on balancing the cost of waiting with the cost of additional servers.

Example 5.2: The Able Baker Carhop Problem


Purpose to indicate simulation procedure when there is more than one channel. Consider a drive-in restaurant
where carhops take orders and bring food to the car. Cars arrive in the manner shown in Table 5.11. There are
two carhops. Able and Baker. Able is better to do the job and works some what faster than Baker.
Table 5.11: Interarrival Distribution Cars
Time between Cumulative Random Digit
Arrivals (min) Probability Probability Assignment
1 0.25 0.25 01-25
2 0.40 0.65 26-65
3 0.20 0.85 66-85
4 0.15 1.00 86-00

Table 5.12: Service Distribution of Able


Cumulative Random Digit
Service time(min) Probability Probability Assignment
2 0.3 0.30 01-30
3 0.28 0.58 31-58
4 0.25 0.83 59-83
5 0.17 1.00 84-00

Table 5.13: Service Distribution of Baker


Service Time(min) Cumulative Random Digit
Probability Probability Assignment
33 0.35 0.35 01-35
4 0.25 0.60 36-60
5 0.20 0.80 61-80
6 0.20 1.00 81-00

A simplifying rule is that Able gets the customer if both carhops are idle.
The problem is to find how well the current arrangement is working. To estimate the system measures. A
simulation of 1 hour-of operation will be used.

Analysis

1) Baker was busy only 69% of the time – (Seniority rule)


2) Nine of the 26 arrivals (35%) had to wait. Average waiting time for all customers was only 0.42 min
(25 sec) which is very small
3) Those nine, who did have to wait, only waited an average of 1.22 min
4) In summary, the system is well balanced. One server cannot handle all the divers and three servers
would probably too many. Adding an additional server would surely reduce the waiting time to nearly
zero. However, the cost of waiting would have to be quite high to justify an additional server.
Table 5.14 Simulation Table for Carhop Example.
Able Baker
Custom Random TimeBe Clock Random Time Service Time Time Service Time Time in
er Digits tween Time of Digits Service Time Service Service Time Service Queue
No for Arrivals Arrival for Begins Ends Begins Ends
Arrival Service

1 - - 0 95 0 5 5 0
2 26 2 2 21 2 3 5 0
3 28 4 6 51 6 3 9 0
4 90 4 10 92 10 5 15 0
5 26 2 12 89 12 6 18 1
6 42 2 14 38 15 3 18 0
7 74 3 17 13 18 2 20 0
8 80 3 20 61 20 4 24 0
9 68 3 23 50 23 4 27 0
10 22 1 24 49 24 3 27 0
11 48 2 26 39 27 3 80 1
12 34 2 28 53 28 4 32 0
13 45 2 30 88 30 5 35 0
14 24 1 31 01 32 3 35 1
15 34 2 33 81 35 4 39 2
16 63 2 35 53 35 4 39 0
17 38 2 37 81 39 4 43 2
18 80 3 40 64 40 5 45 0
19 42 2 42 01 43 2 45 1
20 56 2 44 67 45 4 49 1
21 89 4 48 01 48 3 51 0
22 18 1 49 47 49 3 52 0
23 51 2 51 75 51 5 56 0
24 71 3 54 57 54 3 57 0
25 16 1 55 87 56 6 62 1
26 92 4 59 47 59 3 62 0
56 43 11
5.2 Simulation of Inventory Systems

An important class of simulation problems involves inventory systems. A simple inventory system is shown in
Figure 5.7. This inventory system has a periodic review of length N at which time the inventory level is
checked. An order is made to bring the inventory up to the level M. At the end of the first review period, an
order quantity, Q1, is placed. In this inventory system the lead time (i.e., the length of time between the
placement and receipt of an order) is zero. Since demands are not usually known with certainty, the order
quantities are probabilistic. Demand is shown as being uniform over the time period in Figure 5.7. In actuality,
demands are not usually uniform and do fluctuate over time. One possibility is that demands all occur at the
beginning of the cycle. Another realistic possibility is that the lead time is other than zero and probabilistic.

Figure 5.7. Probabilistic order-level inventory system.

Notice that in the second cycle, the amount in inventory drops below zero, indicating a shortage. In
Figure 5.7, these units are backordered; when the order arrives, the demand for the backordered items is
satisfied first. To avoid shortages, a buffer, or safety, stock would need to be carried.
Carrying stock in inventory has an associated cost attributed to the interest paid on the funds borrowed to
buy the items (this also could be considered as the loss from not having the funds available for other investment
purposes). Other costs can be placed in the carrying or holding cost column: renting of storage space, hiring
guards, and so on. An alternative to carrying high inventory is to make more frequent reviews, and
consequently, more frequent purchases or replenishments. This has an associated cost: the ordering cost. Also,
there is a cost in being short. Customers may get angry, with a subsequent loss of good will. Larger inventories
decrease the possibilities of shortages. These costs must be traded off in order to minimize the total cost of an
inventory system.
The total cost (or total profit) of an inventory system is the measure of performance. This can be affected
by the policy alternatives. For example, in Figure 5.7 the decision maker can control the maximum inventory
level, M, and the length o: the cycle, N. What effect does changing TV have on the various costs?
In an (M, N) inventory system, the events that may occur are: the demand for items in the inventory, the
review of the inventory position, and the receipt of an order: at the end of each review period. When the lead
time is zero, as in Figure 2.7, the last two events occur simultaneously.

Example 5.3 The Newspaper Seller‘s Problem


(Only a single time period of finite length is relevant and only; single procurement is made. Inventory remaining
at the end of the single time period is sold for scrap or discarded. A wide variety of real-world problems are of
this form, including the stocking of spare parts, perishable items, style goods, and special seasonal items

A classical inventory problem concerns the purchase and sale of newspapers. The paper seller buys the papers
for 33 cents each and sells them for 50 cents each Newspapers not sold at the end of the day are sold as scrap
for 5 cents each. News papers can be purchased in bundles of 10. Thus, the paper seller can buy 50, 60 and so
on. There are three types of newsdays, "good," "fair," and "poor," with probabilities of 0.35, 0.45, and 0.20,
respectively. The distribution of papers demanded on each of these days is given in Table 5.15. The problem is
to determine the optimal number of papers the newspaper seller should purchase. This will b accomplished by
simulating demands for 20 days and recording profits from sale each day.
Table 5.15. DISTRIBUTION OF NEWSPAPERS DEMANDED
Demand Probability Distribution
Demand Good Fair Poor
40 0.03 0.10 0.44
50 0.05 0.18 0.22
60 0.15 0.40 0.16
70 0.20 0.20 0.12
80 0.35 0.08 0.06
90 0.15 0.04 0.00
100 0.07 0.00 0.00

The profits are given by the following relationship:

Profit = Revenue from - cost of - lost profit from + salvage from sale of scrap
sales newspapers excess demand papers

From the problem statement, the revenue from sales is 50 cents for each paper sold The cost of newspapers is
33 cents for each paper purchased. The lost profit from excess demand is 17 cents for each paper demanded that
could not be provided.
Such a shortage cost is somewhat controversial; but makes the problem much more interesting. The salvage
value of scrap papers is 5 cents each.
Tables 5.16 and 5.17 provide the random digit assignments for the types of newsdays and the demands for
those newsdays. To solve this problem by simulation requires setting a policy of buying a certain number of
papers each day, then simulating the demands for papers over the 20-day time period to determine the total
profit. The policy (number of newspapers purchased) is moved to other values until the daily profit decreases at
the level before and the level after that value. The value in between is a good estimate for the number of papers
the newspaper seller should purchase.

Table 5.16. RANDOM DIGIT ASSIGNMENT FOR TYPE OF NE.WSDAY


Type of Probability Cumulative Random Digit
Newsday Probability Assignment
Good 0.35 0.35 01-35
Fair 0.45 0.80 36-80
Poor 0.20 1.00 81-00

Table 5.17. RAMDOM Digit ASSIGNMENTS FOR NEWSPAPERS DEMANDED


Cumulative Distribution Random Digit Assignment

Demand Good Fair Poor Good Fair Poor


40 0.03 0.10 0.44 01-03 01-10 01-44
50 0.08 0.28 0.66 04-08 11-28 45-66
60 0.23 0.68 0.82 09-23 29-68 67-82
70 0.43 0.88 0.94 24-43 68-88 83-94
80 0.78 0.96 1.00 44-78 89-96 95-00
90 0.93 1.00 1.00 79-93 97-00
100 1.00 1 .00 1.00 94-00

The simulation table for purchasing 70 newspapers is shown in Table 5.18.


On day 1 the demand is for 60 newspapers. The revenue from the sale of 60 newspapers is $30.00. Ten
newspapers are left over at the end of the day. The salvage value at 5 cents each is 50 cents. The profit for the
first day is determined as follows: Profit = $30.00 - $23.10 - 0 + $.50 = $7.40
On the fifth day the demand is greater than the supply. The revenue from sales is $35.00, since only 70 papers
are available under this policy. An additional 20 papers could have been sold. Thus, a lost profit of $3.40 (20 x
17 cents) is assessed. The daily profit is determined as follows: Profit = $35.00 - $23.10 - $3.40 + 0 = $8.50
The profit for the 20-day period is the sum of the daily profits, $174.90. It can also be computed from the totals
for the 20 days of the simulation as follows: Total profit = $645.00 - $462.00 - $13.60 + $5.50 = $174.90

Table 5.18 SIMULATION TABLE FOR PURCHASE OF NEWSPAPERS


Day Random Type of Random Demand Revenue Lost Profit Salvage Daily
Digits for Newsday Digits from Sales from from Sale Profit
Type of for Excess of Scrap
Newsday Demand Demand
1 94 Poor 80 60 $30.00 — $0.50 $7.40
2 77 Fair 20 50 25.00 — 1.00 2.90
3 49 Fair 15 50 25.00 — 1.00 2.90
4 45 Fair 88 70 35.00 _ _ 11.90
5 43 Fair 98 90 35.00 $3.40 — 8.50
6 32 Good 65 80 35.00 1.70 — 10.20
7 49 Fair 86 70 35.00 — — 11.90
8 00 Poor 73 60 30.00 — 0.50 7.40
9 16 Good 24 70 35.00 — _ 11.90
10 24 Good 60 80 35.00 1.70 _ 10.20
11 31 Good 60 80 35.00 1.70 _ 10.20
12 14 Good 29 70 35.00 _ — 11.90
13 41 Fair 18 50 25.00 _ 1.00 2.90
14 61 Fair 90 80 35.00 1.70 _ 10.20
15 85 Poor 93 70 35.00 _ _ 11.90
16 08 Good 73 80 35.00 1.70 _ 10.20
17 15 Good 21 60 30.00 — 0.50 7.40
18 97 Poor 45 50 25.00 _ 1.00 2.90
19 52 Fair 76 70 35.00 _ — 11.90
20 78 Fair 96 80 35.00 1.70 - 10.20
$645.00 $13.60 $5.50 $174.90

The determination of the optimal number of newspapers to purchase is left as an exercise for the reader.
EXAMPLE 5.4 SIMULATION OF AN (M,N) INVENTORY SYSTEM
This example follows the pattern of the probabilistic order-level inventory system shown in Figure 5.7. Suppose
that the maximum inventory level. M. is 11 units and the review period, N is 5 days. The problem is to estimate,
by simulation, the average ending units in inventory and the number of days when a shortage condition existed.
The distribution of the number of units demanded per day is shown in Table 5.19. In this example, lead time is a
random variable, as shown in Table 5.20. Assume that orders are placed at the close of business and are received
for inventory at the beginning of business as determined by the lead time.
Table 5.19 RANDOM DIGIT ASSIGNMENTS for DAILY DEMAND
Demand Probability Cumulative Random Digit
Probability Assignment

0 0.10 0.10 01-10


1 0.25 0.35 11 -35
2 0.35 0.70 36-70
3 0.21 0.91 71-91
4 0.09 1.00 92-00
Table 5.20 RANDOM DIGIT ASSIGNMENTS FOR LEAD TIME
Lead Time Probability Cumulative. Random Digit
(Days) Probability Assignment
1 0.6 0.6 1-6
2 0.3 0.9 7-9
3 0.1 1.0 0

To make an estimate of the mean units in ending inventory, many cycles would have to be simulated. For
purposes of this example, only five cycles will be shown.
The random digit assignments for daily demand and lead time are shown in the rightmost columns of Tables
5.19 and 5.20. The resulting simulation table is shown in Table 5.21. The simulation has been started with the
inventory level at 3 units and an order of 8 units scheduled to arrive in 2 days‘ time.
Following the simulation table for several selected days indicates how the process operates. The order for 8
units is available on the morning of the third day of the first cycle, raising the inventory level from 1 unit to 9
units. Demands during the remainder of the first cycle reduced the ending inventory level to 2 units on the fifth
day. Thus, an order for 9 units was placed. The lead time for this order was 1 day. The order of 9 units was
added to inventory on the morning of day 2 of cycle 2.

Table 5.21 Simulation TABLE FOR (M, N) INVENTORY SYSTEM


Cycle Day Beginning Random Demand Ending Shortage Order Random Days
inventory Digits Inventory Quantity Quantity Digit for Until
for Lead Order
Demand Time Arrives
1 1 3 24 1 2 0 - 1
2 2 35 1 1 0 - 0
3 9 65 2 7 0 - -
4 7 81 3 4 0 - -
5 4 54 2 2 0 9 5 1
2 1 2 03 0 2 0 - 0
2 11 87 3 8 0 - -
3 8 27 1 7 0 - -
4 7 73 3 4 0 - -
5 4 70 2 2 0 9 0 3
3 1 2 47 2 0 0 - 2
2 0 45 2 0 2 - 1
3 0 48 2 0 4 - 0
4 9 17 1 4 0 - -
5 4 09 0 4 0 7 3 1
4 1 4 42 2 2 0 - 0
2 9 87 3 6 0 - -
3 6 26 1 5 0 - -
4 5 36 2 3 0 - -
5 3 40 2 1 0 10 4 1
5 1 1 07 0 1 0 - 0
2 11 63 2 9 0 - -
3 9 19 1 8 0 - -
4 8 88 3 5 0 - -
5 5 94 4 1 0 10 8 2
87
Notice that the beginning inventory on the second day of the third cycle was zero. An order for 2 units on (hat
day led to a shortage condition. The units were backordered on that day and the next day also. On the morning
of day 4 of cycle 3 there was a beginning inventory of 9 units. The 4 units that were backordered and the 1 unit
demanded that day reduced the ending inventory to 4 units.
Based on live cycles of simulation, the average ending inventory is approximately 3.5 (87/25) units. On 2 of 25
days a shortage condition existed.

6.0 Simulation Programming Languages

6.1 Simulation Programming Languages Listing


The languages are shown in Table 6.1
Table 6.1: Languages and developers
Language Developers
GPSS/H, Wolverine Software Corporation
GPSS/PC Minuteman Software
SIMAN V Systems Modeling Corp.
SIMSCRIPT II.5 CACI Products Company
SLAM II Pritsker Corporation in Indiana
MODSIM III

6.2 Advice on Software Selection


1. Consider the accuracy and detail required versus what can be achieved with the software being
considered
2. Select the greatest power that can be afforded (it is expensive to have analysts wait)
3. Beware of fancy advertisements and demonstrations
4. Beware of checklists with ―yes‖ and ―no‖ as entries. Implementation and capability is what is
important)
5. Ask the vendor to solve a small version of your problem
6. Powerful simulation software can eliminate the need for a feature. This is better than checking the
presence or absence of that feature
The summary of the features and their descriptors are shown in Table 6.2, Table 6.3 and Table 6.4
Table 6.2: Input Features
Feature Descriptor
Interface with general programming language Accept code in FORTRAN, C, Pascal, etc.
Input data analysis capability Empirical or mathematical description of raw data
Portability Run same model on PCs, workstations, etc.
Syntax Easily understood, consistent, unambiguous
Input flexibility Accepted both interactively and in batch form
interactive debugger Break, trap, run until, step. etc.
Modeling flexibility Process interaction, event perspectives
Modeling conciseness Powerful blocks or nodes
Table 6.3: Processing Features
Feature Descriptor
Execution speed Usually many scenarios, many replications need
to be simulated
Model Size A concern only under plain DOS
Material Handling Transporters, conveyors, AGVs, etc.
Random variate generator Exponential , normal, etc
Reset capability For steady state analysis
Independent replications Using a different set of random numbers
Attributes Local values
Global values Data available to all entities
Programmability Incorporate special characteristics
Conditional routing availability Send entities based on prescribed conditions

Table 6.4: Output Features


Feature Descriptor
Standardized reports Average number in queue, etc.
Customized reports Tailored presentation for managers
Statistical analysis Confidence intervals, etc.
Business graphics Bar charts, pie charts, etc.
File creation Input to spreadsheet
Data base maintenance Collect output in an organized manner

You might also like