COMP_494_12_10_22_1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 279

COMP 494: Simulation and Modelling

• Dr.Pheobe N Fedha
• Introduce Modelling, simulation

• Develop appreciation for the need for


simulation

• Applications

• The modelling cycle


Basics of modeling and simulation
• Man has the ability to define what is
likely to happen in the future and to
chose among alternatives.

• To reduce the level of disparity between


outcome and reality, we can use a
decision analysis and support tools to
enable evaluate, compare and optimise
among alternatives.
A simulation
• A simulation is the imitation of the
operation of facility, or real world process
over time.
– know intrcacies
– know measures of performance
• Simulation model: is a computer model that
imitates real life situation.

• What's being simulated is the behavior of the


system as it evolves over time.
Simulation
• According to Shannon : "Simulation is the process
of designing a model of a real system and
conducting experiments with this model for the
purpose of understanding the behavior (with the
limits imposed by a criterion or set of criteria) for
the operation of the system".

• This can assist in the design, creation, and


evaluation of complex systems.
• Designers, program managers, analysts,
and engineers use computer simulation and
modeling to understand and evaluate ‘what
if’ case scenarios.

• It is useful when changes to the actual


system are difficult to implement, involve
high costs, or are impractical e.g. weather
forecasting, flight simulators and car crash
modeling.
• The model takes a set of
assumptions/approximations concerning the
operation of the system i.e.
– Mathematical relationships
– Logical relationships(Process)
– Symbolic relationships
• A simulation model involves generation of artificial
history of a system and drawing inferences from it.

• If the model structure is simple we can use


mathematical models to answer questions of
interest.
Through system simulation: We can Perform
experiments to understand the behavior of a
system and evaluate new strategies.
– Live
– Virtual
– Constructive

This can be done by observing events,


processes, properties and behavior of system
with a computer model.
• Simulation can be viewed as a numerical
technique for solving Complicated
probability models, Ordinary differential
equation and Partial differential
equation.
Formal Definition(s)
• Simulation is a technique for studying
real-world dynamical systems by
imitating their behavior using a
mathematical model of the system
implemented on a digital computer.
DIM
• An image is a 2-D light intensity function f(x,y).
• This digital image f(x,y) is discretised both in
spatial coordinates and brightness.
• Its a matrix whose rows, column indices specify a
point in the image and the element (pixel) value
identifies grey value at that point.
• Infinite points in the image.
f(x,y)=r(x,y)*i(x.y) we can get analytical
solutions
img= imread('apple.jpg');
• Scientists and engineers Translate
mathematical expressions into
computer codes that allow imitate
the operation of the system over
time.

• The simulation provides insight into


the processes associated with the
model.
IN MATLAB
• Simulink is an interactive environment
for modeling, simulating, and analyzing
dynamic, multidomain systems.

• It lets you build a block diagram,


simulate the system’s behavior,
evaluate its performance, and refine
the design.
• Simulink integrates seamlessly
with MATLAB, providing you
with immediate access to an
extensive range of analysis and
design tools.

• These benefits make Simulink


the tool of choice for control
system design, DSP design,
communications system design,
and other simulation
• No universal models exist that can
accurately simulate any business
process.

• Depending on the industry or the


nature of the task, the process may
change over time or contain many
unique unknowns which require
simulation.
Simulation vs Actual System
• Scientific visualization is concerned with data
extraction to determine which data values are
important and which are not.

– A two dimension graph


– A three dimension image

• Visual representation helps identify


important features of the model output
The nature of simulation
• Most complex systems require models that
are complex to be valid. uncertainty is ever-
present arising from the model itself,
theoretical flaws, design flaws, and logical
errors.

• These must be studied via simulation i.e.


evaluate the model numerically and collect
data to estimate model characteristics.
Example consider:
• If Egerton University were to expand its
existing affiliated colleges. The question
would be whether;
• To build and see if it works or
• Simulate the current scenario and expand its
operations to help investigate issues along
the way quickly and cheaply.
• Modeling is the process of representing a
model its construction and its workability.

• Modeling is creating a model which


represents a physical system including its
properties.

• The model should be similar to a real system,


to help the analyst predict the effect of
changes to the system.
• A computer model: is a simulation of a situation in
the real world or an imagery which has parameters
that the user can alter

• Modeling and simulation: Is a discipline for


developing a level of understanding of the
interaction of the part of a system and the
system as a whole.

• To measure and estimate performance, improve


operations and prepare for failures
• Physical model
• Virtual 3d model; mathematical representation
• Conceptual modelling; formally describing
physical images
• Game theory model
• Statistical modellling
• Logical model
• Drug screening is such an example of how
computer modeling can shorten the time for
discovery.

• The drug screening pipeline requires a model of a


target protein or macromolecular structure that is
associated with a specific disease mechanism.

• A list of potential candidate compounds is then


tested to see which have the highest affinity to
bind to that protein, potentially inhibiting the
medical problem (COVID 19).
• Another example is when we want to decide
on a travel route that gets us to several
shopping locations faster or with the fewest
traffic headaches.

• To do this, we analyze information from


previous trips to make an informed decision
about where there may be heavy traffic,
construction, or other impediments to our
trip
Formal Definition(s)
• A model describes the mathematical
relationship between inputs and outputs.

• A model is a pattern, plan, representation


or description designed to show the main
object, workings of an object ,system or
concept.

• A model is a mathematical representation


of a system
• Models allow simulating and analyzing the
system. They are never exact
• Modeling depends on your goal
– A single system may have many models
– Always understand the purpose of the model
– Large libraries of standard model templates exist
– The main goals of modelling is ;
• Conceptual analysis
• Detailed analysis
A Simulation model allows;

• An entire distribution of results not simply a single


bottom line result.

• Each different set of values for the uncertain


quantities to be considered a scenario.

• Companies to generate multiple scenarios each


leading to a particular output.

• At the end you see a whole list of distribution


outputs not a single best guess. i.e the average
GETTING ANSWERS FROM MODELS
The simulation model allows;

• Determine how sensitive a system is to


changes in operating conditions.

• It enables managers to answer what if


questions without actually changing or
building a physical system.
• A spreadsheet simulation is similar to
other modelling applications. Where you
start with input variables and relate to
appropriate excel formulas to produce
output variables of interest.

• The main difference is simulation uses


random numbers to drive the whole
process. These random numbers are
generated with special functions.
Use Simulation to
• Study internals of a complex system e.g.
biological system

• Optimise an existing design e.g. routing


algorithms, assembly line

• Examine effect of environmental changes e.g.


weather forecasting

• When it is impossible to observe/influence/build


Use Simulation to
• Know if the system is dangerous or destructive e.g.
atom bomb, atomic reactor, missile launching

• Study importance of variables

• Verify analytic solutions (theories)

• Test new designs or policies

• To inspect system internals that might not


Use Simulation to
• Get insights into system behavior. By
allowing one to ask what if questions about
how the system change
under different circumstances of model and
its underlying mathematical structure.

• Adjust system parameters in the simulation


model, allow assessment of sensitivity i.e.
scale of impact on the overall system
behavior.
Use Simulation to;
• Verify analysis of a complex system, or as a
teaching tool to provide insight into
analytical techniques

• To instruct, or avoid tying up or damaging an


expensive, actual system (e.g., a flight
simulation vs. use of multimillion dollar
aircraft)
Advantages of Modelling and Simulation
• They are cheaper, safer.

• Faster or slower

• More configurable and controllable

• They are less expensive. E.g. practical simulators are


used to train pilots.

• Direct Experimentation can be disruptive


Advantages of Modeling and Simulation:
• Easy to understand: Allows to understand how the
system really operates without working on real-time
systems.

• Easy to test: Allows to make changes into the


system and their effect on the output without
working on real-time systems.

• Easy to upgrade: Allows to determine the system


requirements by applying different configurations
Advantages of Simulations
• It is used to verify analytical solutions

• They are easier to control than the real world coun


terparts.

• Animation shows the operations so that a plan


can be visualised.

• Designed for training: Learning without the cost


and disruption i.e. on the job training
Advantages of Simulations
• Time scale can be altered as needed i.e. time
compression or expansion

• It allows comparisons of alternative designs or


operating policies

• When mathematical analysis methods are not


available, simulation may be the only investigation
tool

• When mathematical analysis methods are available


but are so complex simulation may provide a solution
Advantages of Simulations
• Models help us frame our thinking about objec
ts in the real world.

• Simulated system imitate the operation of


actual system over time .

• Conclusions about actual system


characteristics can be inferred i.e. the actual
system (real system) is compared with
simulation
Advantages of Simulations
• Artificial history of system can be generated
and observed

• Helps study experimentation with internal


interactions of a complex system or a
subsystem within a complex system.
– Internal (perhaps unobservable) behavior of
system can be studied
Advantages of Simulations
• Informational, organizational and
environmental changes can be simulated and
the effect observed

• By varying inputs and observing the


resulting output valuable insights may be
obtained into which variables are most
important and how variables interact.
Advantages of Simulations
• The knowledge gained can be of great
value in suggesting areas of
improvement in the system under
investigation

• Used to experiment with new designs or


policies prior to implementation so as to
prepare for what may happen.
Advantages of Simulations
• Easy to identifying constraints: Allows to perform
bottleneck analysis that causes delay in the work
process, information, etc.

• Easy to diagnose problems: Certain systems are so


complex that it is not easy to understand their
interaction at a time.

• Modelling & Simulation allows to understand all the


interactions and analyze their effect. Additionally,
new policies, operations, and procedures can be
explored without affecting the real system.
• It provides a way to study complex, real world systems
that cannot be accurately described by a mathematical
model that can be evaluated analytically.

• Allows estimation of an existing system under some


projected set of operating conditions.

• Allows comparisons of alternate proposed system


designs to see which one best meets a specified
requirement.

• Allows study a system with a long time frame in


compressed time, or alternatively study detailed
working of a system in expanded time.
Disadvantages:
• Manpower and time-consuming

• Each stochastic simulation provides only


estimates of solution, only solves one
parameter at a time, can take a large amount
of development and/or computer time.

• Don’t use computer simulation if a common-


sense or analytical solution is available, or if
resources are insufficient, or if simulation
Disadvantages:
• Provides only individual, not general
solutions

• Mistakes may be made in the programming


or rules of the simulation or model.

• The cost of a simulation or running several


different simulations model can be high.

• Simulation results are difficult to translate. It


requires experts to understand and Time to
make sense of the results.
Disadvantages:

• Designing a model is an art which requires domain


knowledge, training and experience.

• Operations are performed on the system using


random number, hence difficult to predict the result.

• Simulation requires manpower and it is a time-


consuming process.

• Simulation process is expensive.


Pitfalls to the successful completion of
a simulation study
 Failureto have a well-defined set of objectives at
the beginning of the simulation study

 Inappropriate level of model detail

 Failure to communicate with management


throughout the course of the simulation study

 Misunderstanding of simulation by management

 Treating a simulation study as if it were primarily


an exercise in computer programming
Pitfalls to the successful completion of
a simulation study
 Using the wrong performance measure

 Failure to collect good system data

 Inappropriate simulation software

 Failure to have people with a knowledge of simulation methodology


and statistics on the modeling team

 Obliviously using simulation software products whose complex


statement may not be well documented and may not implement
the desired modeling logic
Don’t use simulation is
• If t is easy to perform direct experiments

• If system behavior is too complex

• If no data is available about the system not even


estimates.

• The large volume of numbers produced by a


simulation study often creates a tendency to
place greater confidence in a study results than
Application Areas
• It is used to study the internal structure of a
complex system such as the biological
system.

• It is used while optimizing the system design


such as routing algorithm, assembly line, etc.

• It is used to test new designs and policies. It


is used to verify analytic solutions.

APPLICATION AREAS
Designing and analyzing manufacturing systems
• Evaluating military weapons systems or their logistics
requirements
• Determining hardware requirements or protocols for
communications networks
• Determining hardware and software requirements for a
computer system
• Designing and transportation systems such as airports,
freeways, ports, and subways
• Evaluating designs for service organizations such as call
centers, fast-food restaurants, hospitals, and post offices
• Reengineering of business processes
• Determining ordering policies for an inventory system
• Analyzing financial or economic systems
Application Areas
• Military applications,

• training & support,

• designing semiconductors,

• telecommunications,

• civil engineering designs & presentations,

• E-business models.
next
Formal Definition(s)
• Object is an entity which exists in the real
world that enable study the behavior of a
model.

• Conceptual/Base Model is a hypothetical


explanation of object properties and its behavior,
which is valid across the model (choosing what to
model, and what not to model).

• which model should we choose?


• Whether to build the model that contains as
much detail as possible.
– This model is closest to the real system and so the most
accurate.
• The problem is
– we have limited knowledge of the real system
and limited time,
– the real system rarely exists at the time of
modeling (it is a proposed world) and a decision
needs to be made given the time frame.
• To develop a simplified model, we need to
determine the level of abstraction at which to
work.

• Conceptual modeling is the abstraction of a


simulation model from the part of the real
world it is representing (‘the real system’).
DICTIONARY def
• Conceptual of, relating to, concerned
with, concepts, abstract.

• It concerns with the definitions or


relations of concepts rather than facts.

• Concept is an idea of what something is


or how it works; a mental image.
QNS
• If mental how do we document and
communicate?

• If entity/object, relationship, identifier,


domains is this logical

• If we were to add foreign key is this an ER or


relational
Levels of Data Models
• Conceptual modeling: (Robinson 2008a)‘…
Is a non-software specific description of the
computer simulation model (that will be, or
has been developed), describing the
objectives, inputs, outputs, content,
assumptions and simplifications of the
model.’

• It consists of concepts used to help people


know, understand, or simulate a subject the
model represents.
A conceptual model, when implemented properly will ,
• Enhances an individual's understanding of the
representative system

• Facilitate efficient communication of system


details between stakeholders

• Provide a point of reference for system designers


to extract system specifications

• Document the system for future reference and


provide a means for collaboration
To model answer these questions;
Conceptual: is high level,
enterprise wide, abstract model

–What content will the conceptual


model represent?

–How will the conceptual model be


presented?
• Who will be using or participating in the
conceptual model?

• How will the conceptual model describe


the system?

• What is the conceptual models focus of


observation?

• Will the conceptual model be efficient or


CONCEPTUAL DATA MODEL?
It is a pictorial representation of entities and
its relattionships
• Only entities will be visible
• There is abstract relationship
• Easily understood
• Highly abstract
• No software is required to define the conceptual
data model.
The hardest part is in building the
appropriate conceptual model and
assembling data
Dictionary def;
Logical;
• Of or according to the rules of logic or
formal argument; characterized by or
capable of clear, sound reasoning.

• Synonyms: natural reasonable, sensible,


undertakable
Logical data model
• A model of some user domain complete
and understandable in the detail needed
to represent that domain, built
according to and consistent with some
formal modelling scheme with a well
defined scope.

• i.e. It must be understandable: defined,


documented and communicated.
LOGICAL MODEL (ENTITIES AND ATTRIBUTES)
• Presence of attributes for each entity
• Key attributes
• Non key attributes
• Primary key and foreign key relationships
LOGICAL MODEL (ENTITIES AND ATTRIBUTES)
• User friendly attribute names
• More detailed than conceptual model
• More effort s required than the conceptual
model
• Database-agnostic (capacity of software to
function with any vendor's database
management system (DBMS)).
• There are data modelling tools available that
one can use e,g, ERWin, Powerdesigner.
Logical model
• It describes the data in much more detail form
compared to conceptual data model without any
dependency on how it will be in the physical data
model.
The Components include;
– Primary and foreign key
– Relationships between entities
– Entity attributes
– tables
Logical Model
• Like the conceptual model the logical
model defines what to store but not
how to store

• It is adapted to the type of data storage


that is used(relational database)
Logical model
• It is not adapted to a particular DBMS
LIKE pOSTGREsql, MySQL, Oracle etc.

• It does not handle physical storage like


views or indexes.

• From conceptual to physical model you


must decide on the tables you want to
use.
Physical model ( Tables, columns, data Types etc)
Physical model should have sufficient
details to implement.

It is a stored representation of logical


model.

It deals with how data is encoded and


stored.
Physical model ( Tables, columns, data Types etc)
It is implemented in some data system
dealing with storage, processing
performance, volumetric (time and
space), partitioning and distribution
Physical Model
• Specifies everything related to how the data
is defined in the logical model and stored

• It is enterprise wide and more detailed.

• It is adapted to specific DBMS to be used

• Objects such as Index, Indices, constraints,


triggers, security, keys, indexes, views are
dealt with
Physical Model
MODEL
• A model is a miniature (abstract)
representation of something

• A pattern of something to be made


• An example for imitation or emulation

• A mathematical model is a representation of


the behavior of real objects phenomena in
mathematical language. E.g. Algebraic,
differential, integral equations , algorithms,
formulae and theorems
• A model, is a simplification of a system
for the purpose of studying

• It must contain sufficient details to


permit valid conclusions to be drawn
about the real system.
• A model is a pattern, plan,
representation or description
designed to show the main object,
workings of an object ,system or
concept. Models give us something
to;
 Think about
 Communicate about
DEFINITIONS
• A system is a collection of entities that
act and interact together under some
definite conditions, that exist in the real
world. OR

• System: any set of interrelated


components acting together to achieve a
common objective.
• A University system consists of professors,
students and employees these objects act
together to achieve the objective of teaching
& learning process.

• A system consists of input elements that


cause changes in the systems variables.
– The inputs are the experimental factors
that are altered in order to try and achieve
the modeling objectives.
• Output Response Systems (process) define the
relationship between the inputs and output
– The outputs are the statistics that inform us
as to whether the modeling objectives was
achieved.
Example: The time required to clear all
students from the University system after
four years and if not, why it is not being
achieved.
• Knowing the objectives, inputs and
outputs of the model informs the content
of the model.
• In a health setup; the model must be
able to receive the inputs (e.g. it must
model the consultation rooms) and it
must provide the outputs (e.g. it must
model the flow of patients until all have
exited the system).

• The model content can be thought of in


terms of the model scope (what to
model) and the level of detail (how to
model it).
• The state of a system is a collection of
variables and their values needed to
describe the system at any particular time
• State variables define the state of the
system e,g length of the queue
• A variable is a mathematical quantity that
defines one key aspect of a system. A
variable may be:
– Endogenous, Exogenous:
• An endogenous variable (dependent) these
are influenced by one or more independent
variables.
• Endogenous(dependent variables): If the value
changes it is because there are changes to its
relationships with other variables in the same
model.

• The amount of crop yields is dependent on many


other variables, such as the weather, soil fertility,
water availability, pests, and diseases.

• E.g. supply and demand factors such as changes in


income, changes in consumer preference, growth
in the economy, availability of alternative goods
and services.
• An exogenous variable is a variable that
depends on external factors outside of
the model, so it is not impacted by
variables within the model.
• E.G. rainfall is exogenous to the process
of farming and crop output.

• Assumptions are made either when


there are uncertainties or beliefs about
the real world being modelled.
Developing ConceptulaModel
• It consist of the following components:
– system entities,

– input variables,

– performance measures,

– functional relationships.
Modelling Concepts
• Creating, testing, and applying
mathematical models require an
iterative process.

• It starts with an initial set of


simplifying assumptions , testing,
alteration, and application of the
model
To create a model;
• make assumptions / approximations,
both logical and mathematical, about
how the real system works

• Distill from the mass of details about the


real system, those aspects that are
essential in studying the system

• Use mathematical methods to answer


questions of interest
Modelling Process
Steps in a Simulation Project
1. Problem formulation Phase 1
Problem Definition
2. Set objectives and overall project plan

4. Data Collection
Phase 2
3. Model conceptualization
Model Building
5. Model Translation

No Phase 3
6. Verified
Yes Experimentation
No No
7. Validated
Yes
8. Experimental Design
Phase 4
Implementation
9. Model runs and analysis

Yes No 11. Documentation, reporting


10. More runs
and
implementation
Steps in a Simulation Study

Problem formulation
Clearly state the problem.
Setting of objectives and overall project plan
How we should approach the problem.
Model conceptualization
Establish a reasonable model.
Data collection
Collect the data necessary to run the simulation (such
as arrival rate, arrival process, service discipline,
service rate etc.).
Model translation
Convert the model into a programming language.
Steps in a Simulation Study

Verification:Verify the model by


checking if the program works properly.
Use common sense.

Validation:Check if the system


accurately represent the real system.

Experimental design: How many runs?


For how long? What kind of input
variations?
Steps in a Simulation Study

Production runs and analysis: Actual


running the simulation, collect and
analize the output.
Repetition: Repeat the experiments if
necessary.
Document and report: Document and
report the results.
Steps to develop a simulation model.

Problem formulation: Clearly state the problem.


• Step 1: Examine the problem. Understand
the problem and choose its classification
accordingly, such as deterministic or
stochastic.

– Identify the problem with an existing


system or set of requirements of a
proposed system.
• Prepare a problem statement.
Step 2: Setting of objectives and overall
project plan:
• Analyze the problem and define the
objectives of the model.
– This include a review of the literature to
uncover previous research on the topic,
experimental or field-measured data
showing various states of the system and
the measured outcomes, mathematical
representations of the system derived from
theories, and previous modeling efforts
• Several questions must be addressed while
considering the model objectives:

• What are the outcomes that we expect the


model to predict?

• Are we interested in every possible outcome


or is there a subset of conditions that would
satisfy our model objectives? E.g average,
sum etc.
• What level of accuracy is required
for the predicted outcomes?
– This will impact the nature of
simplifying assumptions, input data,
and computing algorithms that are
required to build the model.
Step 3: Model conceptualization: Establish a
reasonable model.
• Design the conceptual model while taking care
of the existing system factors and limitations.
– Choose input variables and create entities for
the simulation process.
– There are two types of variables decision
variables and uncontrollable variables.
• Decision variables are controlled by the
programmer, these are variables that
change or affect the solution
• Uncontrollable variables are the random
• Step 4: Collect data:
– Collect data as per the system behavior
and future requirements.

– Analyze the system features, its


assumptions and necessary actions to be
taken to make the model successful.

– Determine the variable names, functions,


its units, relationships, and their
applications as used in the model.
Data collection
• Collect the data necessary to run the simulation (such as
arrival rate, arrival process, service discipline, service
rate etc.).

• Collect and start processing the system data,


observing its performance and result.
– Create constraints on the decision variables by assigning
it to the simulation process.

• Provide recommendations after completing the


conceptual process related to the model. It includes
investment, resources, algorithms, techniques, etc.
Step 5: Model translation convert the model into a
programming language.

• Develop the model using network


diagrams and verify it using various
verifications techniques.
.
Verification
• Verification—Was the system built right?
– Determine the output variables

• The process of determining whether a


simulation computer program works as
intended and that data accurately represent
the developer’s conceptual description and
specifications.

• Compare the model’s implementation with


the developer's conceptual description and
specifications. (debugging)
Verification
• Answers the question has the
model and simulation been built so
that they fully satisfy the
developer’s intent (as indicated in
specifications)?
• Verification (efficiency)
–Is the model correctly built /
programmed?
VERIFICATION
• Includes inspection by QA engineers to
confirm that product or service meets the
specified specifications.

• Also known as qualification and must pass


before validation.

• Is done through inspection against drawings,


document reviews, visual checks through
actual site visits and alternative calculations
Validate the model by comparing its performance
under various conditions with the real system.
Step 6: Validation

• Collect data from the real-life system to input


into the simulation

Answer the question are we building the


right system/product.
• This include dynamic testing or simulations
of product or service to confirm that they
meet product applications or purpose.
Validation;
• Confirms product or service performance in
actual working or usage conditions.

• Is done through human based testing or


computer based simulations by testing or
simulation teams.

• Is initiated only after product or service


passes verification
Validation - an Iterative Calibration Process
Validation
• Validation is the process of comparing
two results i.e. compare the
representation of a conceptual model to
the real system.

• The process of determining whether the


conceptual model is an accurate
representation of the actual system from
the perspective of the intended uses of
the model.
Validation
• Did I build the right thing? Will the
model or simulation be able to
adequately support its intended use?
Validation (effectiveness)
–Is the right model built?

–Does the model adequately


describe the reality you want to
model?

–Does the involved decision makers


trust the model?
Validation and verification
KEY DIFFERENCE

• Verification process includes checking of


documents, design, code and program whereas
Validation process includes testing of the actual
product.

• Verification does not involve code execution while


Validation involves code execution.

• Verification checks whether the software confirms


a specification whereas Validation checks whether
the software meets the requirements and
expectations.
KEY DIFFERENCE

• Verification finds the bugs early in the development cycle


whereas Validation finds the bugs that verification can not
catch.

• Comparing validation and verification in software testing,


Verification process targets on software architecture, design,
database, etc. while Validation process targets the actual
software product.

• Verification is done by the QA team while Validation is done


by the involvement of testing team with QA team.

• Comparing Verification vs Validation testing, Verification


process comes before validation whereas Validation process
Can a product pass verification and fail in
validation
• When product application or usage condition
are not factored out while finalising product
or service requirements.

• Wrong assumptions about real working


conditions while finalising product or service
requirements.
Step 7: Experimental design:

• Select an appropriate experimental design as


per requirement.
– Choose an appropriate simulation software
to run the model.
•Determine how many runs? For how long?
•What kind of input variations?
•Production runs and analysis: Actual running
the simulation, collect and analyze the output.
•Repetition: Repeat the experiments if necessary.
Step 8: Document and report:
Create a document of the model for future
use, which include objectives,
assumptions, input variables and
performance in detail.
–Develop a flowchart showing the
progress of the simulation process.

–Document and report the results.


Building a Simulation Model
• General Principles
– The system is broken down into suitable
components or entities
– The entities are modeled separately and are
then connected to a model describing the
overall system
• The basic principles apply to all types of
simulation models
– Static or Dynamic
– Deterministic or Stochastic
– Discrete or continuous
• One may go through several
iterations before the model provides
sufficiently accurate results.

• This can be validated against


available experimental or field data
to provide a quantitative assessment
of model accuracy.
• Judgment of whether a model is
giving reasonable results is
sometimes as much an art as a
science.

• Confidence in that judgment is a


function of the experience of the
modeler and the breadth and depth of
the previous research about the system
under study.
Techniques for Validation
• White box testing methods, classes,
details of implementation. This includes
unit and integration testing.

• The internal structure/design/


implementation of the item being
tested is known to the tester.

• Implementation and impact of


the code are tested.
Black box testing:
• Internal structure/design/implementation
of the item being tested is not known to
the tester.

• Only the external design and structure


are tested. Test based on input output (not
concerned with internal details)

– while designing the model discuss with the system


experts
– The model must interact with the client throughout
the process.
Components of a System
• Entities represents an object of interest in the
system whose value can be static or dynamic.
E.g depts, orders,products in case of a factory.

• Attributes are the local values(property) used


by the entity.

• Lists: Lists are used to represent the queues


used by the entities and resources such as
LIFO, FIFO, etc. depending upon the process.
Components of a System
• Activity: Any process causing change in a system.
Its a time period of specified length. e.g
manufacturing process.

• State: The collection of variables necessary to


describe the system at any given time relative to
the objective of the study. i.e. a description of of
all entities, attributes, and activities as they exist
at one point in time.

• Event: A momentary occurrence that may change


Components of a System
• Resources: A resource is an entity that provides
service to one or more dynamic entities at a time.

• The dynamic entity can request one or more units


of a resource; if accepted then the entity can use
the resource and release when completed. If
rejected, the entity can join a queue.

• Delay: It is an indefinite duration that is caused by


some combination of system conditions.
A system
• Defines group of objects that are joined
together in some regular interaction or
interdependence toward accomplishment
of some purpose.
• A system environment. These are
changes occurring outside the system
e.g. Arrival of oders.

• Exogenous system: Is used to describe


activities and events in the environment
that affect the system. E.g.. Arrival of
customers
• Endogenous system: Describes activities and
events occurring within a system. E.g.
withdrawing money

• Closed system: There is no exogenous


activity and event.

• Open system: There is exogenous activity


e.g. a bank system
Open and closed models
– Input is external and independent  open
– if new jobs enter system then open.

– Closed model has no external input: if same


jobs leave and re-enter queue then closed

cpu cpu

open
closed
• A model is defined as a representation of a
system for the purpose of studying the
system e.g. mathematical or physical model,
static, dynamic deterministic,, stochastic and
discrete
Classification of Models
• Static Simulation(Monte Carlo Model):
Represents a system at a particular
point in time not affected with time.

• Dynamic Simulation: include models


which are affected with change over
time.

• The state of the system at any time


period is dependent, on the state of the
system at the previous time period.
Static and dynamic models
– Time is not a variable  static
– If changes with time  dynamic
• \Linear and nonlinear models
– Output is linear combination of input  linear
– Otherwise  nonlinear
Output

Output

Input Input
(Linear) (Non-Linear)
Stable and unstable
– Model output settles down  stable
– Model output always changes  unstable
Output

Output
Time Time
(Stable) (Unstable)
Discrete Systems:
• A probability distribution is discrete if it
has possible number of values. The state
variables change at discrete time points.
Discrete simulation model
• At time zero there is an event: a customer arrives;
at time nine another customer arrives; at time ten
another customer arrives; at time twelve a
customer is served; and so on. These are examples
of events.
• In a bank, the number of customers
change when a customer arrives and
when the service provided to the
customer is completed.

• Others are; grocery stores and


manufacturing applications.

• If countable  discrete Ex: jobs in CPU


queue
Deterministic models
• Contain no random variables and have a
known set of inputs which will result in
unique set of outputs.

• A model is deterministic if its behavior is


entirely predictable. E.g I can measure
temperature for 3 days.

• Given a set of inputs, the model will result


• In a deterministic simulation, all events
and relationships among the variables
are governed by a combination of
known, but possibly complicated, rules.
• Deterministic models deals with
systematic and definitive outcomes as
opposed to random results and they
don’t make allowances for error.

• The relationship allows one to make


predictions and see how one variable
affects the other.
Deterministic and probabilistic models
– If output predicted with certainty 
deterministic
– If output is different for different repetitions 
probabilistic
Output

Output

Input Input
(Deterministic) (Probabilistic)
Stochastic vs deterministic simulations
• A model is deterministic if its
behavior is entirely predictable.
Given a set of inputs, the model will
result in a unique set of outputs.

• A model is stochastic if it has random


variables as inputs, and
consequently also its outputs are
random.
Probabilistic model
• Is a mathematical representation of a
random phenomenon.

• It is defined by its sample space, events


within the same sample space and
probabilities.

• The models estimate based on the past


historical data and probability of the event
Stochastic simulation
• It includes some element of
randomness. The model is likely to
produce different results even with the
same initial conditions.

• There is always the element of chance or


uncertainty involved which implies that
there are possible alternate solutions.
• Stochastic simulation y=5x+Random error has
one or more random variables as inputs.
Random inputs lead to random outputs.

• An example is the spread of a disease say COVID


19 that is passed by human contact.

• A susceptible person may make contact with an


infected person but will not necessarily become
infected.

• An ongoing process where the next step might


depend on both the previous states and some
• The probability of being infected is
related to the virility of the disease, the
state of health of the susceptible person,
and the nature of the contact.

• ‘‘random variables’’ are included in the


model to represent the influence of
factors that are unpredictable,
unknown, or beyond the scope of the
model.
Continuous system
–The state variables change
continuously as a function of time and
the behavior of the system is typically
described by differential equations.
–If uncountably infinite  continuous
• Ex: time spent by students on hardware
• Variables of interest change
continuously over time. i.e. Y=dy/dt.

• Suppose a simulation for a car journey is


to be created where interest is on the
speed of the car throughout the
journey.
A system is linear:
• If it satisfies the super position principle.
• A system satisfies the superposition principle
if the following conditions are satisfied:
– Multiplying the input by any constant, multiplies
the output by the same constant.
– The response to several inputs applied
simultaneously is the sum of individual response
to each input applied separately.
F(ax+by)=a.F(x)+b.F(y)
Symmetric vs skewed
• A probability distribution can either be symmetric
or skewed to the left or right.

• you choose between symmetric or skewed based


on realism.
What is queuing process?

• A queuing process is a model of waiting lines,


constructed so that queue length and waiting
times can be predicted.

• The symbolic representation of a queuing


process makes it easy to simulate its
behavior, estimate its parameters from data,
and compute state probabilities at finite and
infinite time horizons.
What is Queuing Theory?
• Mathematical analysis of queues and waiting
times in stochastic systems.
– Is used extensively to analyze production and
service processes exhibiting random variability in
market demand (arrival times) and service times.
• Queues arise when the short term demand
for service exceeds the capacity
– Most often caused by random variation in service
times and the times between customer arrivals.
– If long term demand for service is greater than
capacity the queue will explode!
Why is queuing theory important.

• Queuing theory is the study of congestion


and waiting in line.

• The theory can help with creating an efficient


and cost-effective workflow, allowing the
user to improve traffic flow.

• Queuing theory can address staffing,


scheduling, and customer service shortfalls.
Why is Queuing Analysis Important?

• Capacity problems are very common in industry


and one of the main drivers of process redesign
– Need to balance the cost of increased capacity
against the gains of increased productivity and
service
• Queuing and waiting time analysis is particularly
important in service systems
– Large costs of waiting and of lost sales due to
waiting
A basic queuing system consists of;
• Arrival process (how customers arrive at
the queue, how many customers are present
in total).

• The queue itself;

• The service process for attending to those


customers;

• Departures from the system.


Simulation of a Queuing System
• A queue is the combination of all entities in
the system being served and those waiting
for their turn.
• A queuing system: Is described by its calling
population, the nature of the arrivals, the service
mechanism, the system capacity, and the queuing
discipline.
queuing system
• The customers arrive at service counter (single or
in groups) and are attended by one or more
servers. A customer served leaves the system after
getting the service.

• A queuing system comprise of the queue and the


service facility.
– The queue is where the customers are waiting to be
served.
– The service facility is customers being served and the
individual service stations.
Components of a Basic Queuing Process

Input Source The Queuing System

Served
Calling Jobs Service Jobs
Queue Mechanism
Population
leave the
system

Arrival Queue
Process Discipline
Service
Queue
Process
Configuration
Components of a Basic Queuing Process
The calling population
– The population from which customers/jobs
originate
– The size can be finite or infinite (the latter is
most common)
– Can be homogeneous (only one type of
customers/ jobs) or heterogeneous (several
different kinds of customers/jobs)
The Arrival Process
– Determines how, when and where
customer/jobs arrive to the system
– Important characteristic is the customers’/jobs’
inter-arrival times
– To correctly specify the arrival process requires
data collection of inter-arrival times and
statistical analysis.
ARRIVAL TYPES:
Random arrivals:
Scheduled arrivals e.g. patients to a physician,
airline arrivals to an airport.
Components of a Basic Queuing Process con’t
The queue configuration;
– Specifies the number of queues: Single or
multiple lines to a number of service stations
– Their location
– Their effect on customer behavior
• Balking and reneging
– System Capacity (# of jobs the queue can hold)
• Distinction between infinite and finite
capacity
Jockeying: Customer enters one line and
switches to another to reduce waiting time
• JO
BALKING: Decides not to enter the waiting
queue
RENEGING: Enter and leave before
service
Example – Two Queue Configurations

Multiple Queues Single Queue

Servers Servers
Multiple v.s. Single Customer Queue
Configuration

Multiple Line Advantages Single Line Advantages

1.The service provided can 1. Guarantees fairness


be differentiated – FIFO applied to all
– Ex. Supermarket express arrivals
lanes 2. No customer anxiety regarding
2. Labor specialization possible choice of queue
3. Customer has more flexibility 3. Avoids “cutting in” problems
4. Balking behavior may be deterred 4. The most efficient set up for
minimizing time in the queue
– Several medium-length
5. Jockeying (line switching) is
lines are less intimidating
avoided
than one very long line
Components of a Basic Queuing Process con’t
The Service Mechanism
– Can involve one or several service facilities with
one or several parallel service channels (servers)
- Specification is required
– The service provided by a server is characterized
by its service time
• Specification is required and typically involve
data gathering and statistical analysis.
• Most analytical queuing models are based on
the assumption of exponentially distributed
service times, with some generalizations.
Components of a Basic Queuing Process
The Queue Behavior and discipline
– Specifies the order by which jobs in the queue
are being served.

– Can entail prioritization based on customer


type.
Prototype Example –Hospital

• Patients arrive by ambulance or by their own


accord

• One doctor is always on duty

• More and more patients seeks help  longer


waiting times

Question: Should another MD position be


created?
A Cost/Capacity Tradeoff Model

Total
cost
Cost

Cost of
service

Cost of waiting

Process capacity
Examples of Real World Queuing Systems?
• Commercial Queuing Systems
– Commercial organizations serving external customers
– Ex. Dentist, bank, ATM, gas stations, plumber, garage …
• Transportation service systems
– Vehicles are customers or servers
– Ex. Vehicles waiting at toll stations and traffic lights,
trucks or ships waiting to be loaded, taxi cabs, fire
engines, elevators, buses …
• Business-internal service systems
– Customers receiving service are internal to the
organization providing the service
– Ex. Inspection stations, conveyor belts, computer
support …
Mitigating Effects of Long Queues
1.Concealing the queue from arriving
customers
– Ex. Restaurants divert people to the bar ,
amusement parks require people to buy
tickets outside the park, banks broadcast
news on TV at various stations along the
queue, casinos night club queues through
slot machine areas.
2.Use the customer as a resource
– Ex. Patient filling out medical history form
while waiting for physician
Mitigating Effects of Long Queues
3. Making the customer’s wait comfortable and
distracting their attention
– Ex. Complementary drinks at restaurants,
computer games, internet stations, food courts,
shops, etc. at airports
4.Explain reason for the wait
5.Provide pessimistic estimates of the
remaining wait time
– Wait seems shorter if a time estimate is given.
6.Be fair and open about the queuing
disciplines used
A Commonly Seen Queuing Model
• Service times as well as interarrival times are assumed
independent and identically distributed
– If not otherwise specified
• Commonly used notation principle: A/B/C
– A = The interarrival time distribution
– B = The service time distribution
– C = The number of parallel servers
• Commonly used distributions
– M = Markovian (exponential) - Memoryless
– D = Deterministic distribution
– G = General distribution
• Example: M/M/c
– Queuing system with exponentially distributed service and inter-
arrival times and c servers
A donut shop
• Suppose we decided to open a donut shop and are
unsure about how many employees to hire to sell
donuts to costumers. The operations of the shop is
the real-world system whose behavior we want to
understand. Given that the shop is not operating
yet, only a simulation model can provide us with
insights.
• We could devise models of different complexities.
– costumers that arrive at our shop at a particular
rate;
– employees (a number to be given as input) that
take a specific time to serve costumers.
• If we consider a donut shop to be a
deterministic model we would assume that a
new customer arrives every 5 minutes and
an employee takes 2 minutes to serve a
customer.

• In a stochastic model we would assume that


the arrival times and the serving time follows
some random variables.
• Mathematical model: use symbolic notations
and mathematical equations to provide
insights and predictions about system
behavior.
To judge applicability consider:
• Scope: Is the model able to define the scope
of the chosen real world problem.

• Complexity: Is the model too simple or too


complex in terms of parameters involved or
are they sufficient to represent the actual
• Computations: what is the computation
cost of the model. Is it reliable.

• Accuracy: Does the model produce


accurate or close to accurate outputs

• Stability: Is the model stable.

• Consistency: Does the model misbehave


with given perturbations
Consider our simple donut shop.
• Clients will be resources
• Employees may either be considered as
entities or resources:
• The queue in the shop is possibly infinite:
whenever a customer arrives she will stay in
the queue independent of how many
customers are already queuing and she will
wait until she is served.
The donut shop example assumptions:
– customers are served on a first-come, first-
served basis.

– there are two employees.

– On average they take the same time to serve a


customer.

– Whenever an employee is free, a customer is


allocated to that employee.

– If both employees are free, either of the two


Elements of a simulation model
• System state: Number of customers waiting to be
served at time ,number of employees busy at time .

• Resources: customers and employees;

• Events: arrival of a customer; service completion by an


employee.

• Activities: time between a customer arrival and the next;


service time by an employee.

• Delay: customers’ waiting time in the queue until an


Simulating a little health center
• To simulate the workings of a little health center. The
length of the activities can be chosen using common
sense, intuition or historical data.

• Patients arrive at the health center and are first


visited by a nurse. Once they are visited by the nurse
they have an actual consultation with a doctor.

• Once they are finished with the doctor, they meet


the administrative staff to schedule a follow-up
appointment.
Assumptions:
• We assume queues to be infinite and that patients
do not leave the health center until they are
served by the administrative staff;

• At all steps patients are visited using a first-come,


first-served basis

• The health center has one nurse, two doctors and


one administrative staff. The two doctors take on
average the same time to visit a patient.
The components of the simulation model are the following:

• System state:
– QN(t): number of patients queuing to see the nurse;
– QD(t): number of patients queuing to see a doctor;
– QA(t): number of patients queuing to see the staff;
– NN(t): number of nurses available to see the patients;
– ND(t): number of doctors available to see patients;
– NA(t): number of administrative staff available to see
patients.
• Resources: patients, nurses, doctors and
administrative staff;

• Events: arrival of a patient, completion of nurse’s


visit, completion of doctor’s visit, completion of
administrative staff’s visit.

• Activities: time between the arrival of a patient


and the next, visit’s times of nurses, doctors and
admin staff.

• Delay: customers’ waiting time for nurses, doctors


and administrative staff
Assumptions

• Nurse visit times follow a Normal distribution with


mean 15 and variance 1;

• Doctor visit times follow a Normal distribution


with mean 20 and variance 1;

• Administrative staff visit times follow a Normal


distribution with mean 5 and variance 1;

• Time between the arrival of patients is modeled as


a Normal with mean 10 and variance 4.
Example
• A social media influencer decides to open a
new page and her target is to reach 100,000
followers in 10 weeks.
– Given her past experience, she assumes that
each week she will get 1.5k new followers that
had never followed the page and of her current
followers she believes 10% will stop following
the page each week.
– However, 20% of those that the left the page in
the past will join again each week.
• Will she reach her target?
Three steps of the simulations
1. Determine the characteristics of
each of the inputs to the
simulation.

These may be modeled as


probability distributions,
continuous or discrete.
2. Construct a simulation table. Each
simulation table is different, based
Three steps of the simulations Cont’d
3. For each repetition i, generate a value for
each of the p inputs, and evaluate the
function, calculating a value of the response
y i.

– The input values may be computed by


sampling values from the distributions
determined in step 1.

– A response typically depends on the inputs


Steps in a Simulation Project
1. Problem formulation Phase 1
Problem Definition
2. Set objectives and overall project plan

4. Data Collection
Phase 2
3. Model conceptualization
Model Building
5. Model Translation

No Phase 3
6. Verified
Yes Experimentation
No No
7. Validated
Yes
8. Experimental Design
Phase 4
Implementation
9. Model runs and analysis

Yes No 11. Documentation, reporting


10. More runs
and
implementation
NEXT
Simulation of Queuing Systems
• In the single-channel queue, the calling
population is infinite.
– 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.
• Arrivals for service occur one at a time in a
random fashion.
– Once they join the waiting line, they are
eventually served.
Simulation of Queuing Systems
• Service times are of some random length
according to a probability distribution which
does not change over time.

• The system capacity has no limit, meaning


that any number of units can wait in line.

• Finally, units are served in the order of their


arrival (FIFO) by a single server or channel.
Simulation of Queuing Systems
• System state : the number of units in
the system and the status of the
server(busy or idle).

• Event: a set of circumstances that cause


an instantaneous change in the state of
the system.
• In a single-channel queuing system
there are two possible events that can
affect the state of the system.
• The arrival event : the entry of a unit
into the system
• The departure event: the completion of
service on a unit.
• Simulation clock : used to track simulated
time.
The Unit-entering-system
• The arrival event occurs when a unit enters the
system.
– The unit may find the server either idle or busy.
• Idle : the unit begins service immediately
• Busy : the unit enters the queue for the server.
queuing system
SERVICE COMPLETION
• If a unit has just completed service, the simulation
proceeds in the manner shown in the flow diagram
Little’s Law:
Mean number tasks in system = arrival
rate x mean response time

• Applies to any system in equilibrium, as


long as nothing in black box is creating
or destroying tasks
Characteristics of queuing theory.
• The key elements of queuing systems are
customers and servers.

• Customer refer to anything that arrive at a


facility and requires service People, Cars,
Machines, Trucks, Airplanes etc.

• Server refer to any resource that provide the


requested service e.g. receptionist,
personnel, runways in airport, washing
Simulation of Queuing Systems
• Simulations of queuing systems require
the maintenance of an event list for
determining what happens next.

• Simulation clock times for arrivals and


departures can then be computed in a
simulation table customized for each
problem.
• In simulation, events usually occur at
random times, the randomness
imitating uncertainty in real life.

• Random numbers are distributed


uniformly and independently on the
interval (0, 1).

• Random digits are uniformly distributed


on the set {0, 1, 2, … , 9}.
The simplest arrival process is one where we
have;
i. Completely regular arrivals (i.e. the same
constant time interval between successive
arrivals).

ii. A Poisson/Stochastic stream of arrivals


corresponds to arrivals at random.
– successive customers arrive after intervals
which independently are exponentially
distributed.
Essential features of Queuing system
1. Calling population

2. Arrival process

3. Service process

4. Number of servers
1. Calling population:
• The population of potential customers is
referred to as the calling population. ( finite,
or infinite).

• Finite model: Arrival rate depends on the


number of customers being served and
waiting.

• This is true if the number of customers being


served or waiting for service is a small proportion
of the whole population.
1. The Calling Population
• The assumption of an infinite population is
that the rate of arrival of customers is not
affected by the number of customers that have
already joined the queuing system.

• In systems with large population, we assume


the population is infinite.

• It can be homogenous (one type of customer)


or heterogeneous(different types of
2. The arrival pattern.

• How customers arrive is characterized by


inter-arrival times e.g. singly or batch (constant
size or of random size).

• How the arrivals are distributed in time (i.e.


what is the probability distribution of time
between successive arrivals (the inter-arrival
time distribution)

• Whether there is a finite population of


3. The service mechanism.
• A description of the resources needed for service
to begin
– How long the service will take (the service time
distribution)
– The number of servers available
– Whether the servers are in series (each server
has a separate queue) or in parallel (one queue
for all servers).
– Whether preemption is allowed (a server can
stop processing a customer to deal with another
"emergency" customer)
Service Times and Service Mechanism
• The service times of successive arrivals are
denoted by S1,S2,… . They may be constant or of
random duration.

• Some service times depend upon the time of


the day or upon the length of the waiting
line.

• Sometimes services are identically


distributed for all customers of a given type
The service mechanism.
• The more the number of service channels in the
service facility, the greater the overall service rate
of the facility.

• The combination of arrival rate and service rate is


critical for determining the number of service
channels.

• One-server model, where the system has only one


server.
• A multi-server model when the system has a
number of parallel channels, each with one server.
• Arrangement of Service depends upon the design
of the system's service mechanism.
The number of service channels.
• Parallel channels imply, there are a number
of channels providing identical service
facilities so that several customers may be
served simultaneously.
The number of service channels.

• Series channel means a customer can go


through successive ordered channels
before service is completed.
Arrangements of Service Facilities (a, b, c)
Determines the Attitude of Customers:
• Patient Customer: Customer arrives at the
service system, stays in the queue until
served, no matter how much he has to wait
for service.

• Impatient Customer: Customer arrives at the


service system, waits for a certain time in the
queue and leaves the system without getting
service(long queue).
Queue Behavior
• This refer to the actions customers take
while in a queue waiting for service to
begin(bulk, renege or jockey
).

• Balking: Customer decides not to join


the queue by seeing the number of
customers already in service system.
• Reneging: Customer after joining the
queue, waits for some time and leaves
the service system due to delay in
service.

• Jockeying: Customer moves from one


queue to another thinking that he will
get served faster by doing so. E.g.
supermarket.
4. The queue discipline.

• Queue discipline refers to the logical


ordering of customers in a queue and
determines which customer will be chosen
for service when a server becomes free.

• Queue discipline refers to the rule that a


server uses to choose the next customer
from the queue when the server completes
the service of the current customer.
• Common queue disciplines include;
– first-in-first-out (FIFO);

– last-in-first-out (LIFO);

– service in random order (SIRO);

– shortest processing time first (SPT);


Common queue disciplines
• First in first out: The customers are served
one at a time and that the customer that has
been waiting the longest is served first.

• E.g. Prepaid taxi queue at airports are


engaged on a first-come, first-served basis.

• Last in first out : The last customer will be


served first. Also known as a stack.
• Assume there are letters to be
processed accumulated in a pile,
each new addition being put on the
top of them.

• The clerk might process these letters


or orders by taking each new task
from the top of the pile.
• An arrival task would be the next
to be serviced provided that no
fresh task arrives before it is
picked up.

• Similarly the people who join the


elevator, the last are the first
ones to leave it.
Common queue disciplines
• Processor sharing: Service capacity is shared
equally between customers.

• Priority : Customers with high priority are


served first.
– Non-preemptive (where a job in service
cannot be interrupted) and
– preemptive (where a job in service can be
interrupted by a higher priority job).
Common queue disciplines
• Shortest job first: The next job to be served is
the one with the smallest size

• Preemptive shortest job first: The next job to


be served is the next one with the smallest
size.

• Shortest remaining processing time: The next


job to be served is the one with the smallest
remaining processing requirement.
• Dynamic queue disciplines are based on the
individual customer attributes in the queue.
E.g.

• Service In Random Order (SIRO): Customers


are selected for service at random,
irrespective of their arrivals in the service
system.

• Meaning every customer in the queue is


equally likely to be selected.
• Priority Service: Under this rule customers
are grouped in priority classes on the basis of
some attributes such as ;

• Service time, urgency or according to some


identifiable characteristic, and FCFS rule is
used within each class to provide service.

• E.g. Treatment of VIPs: Preference to other


patients in a hospital.
5 System Capacity
• In many queuing systems there is a limit to
the number of customers that may be in the
waiting line or system

• E.g. An automatic car wash might have room


for only 10 cars to enter the mechanism.

• An arriving customer who finds the system


full does not enter but returns immediately
to the calling population.
e.g. Covid 19 in some hospitals. When a
system has a limited capacity, a distinction is
made between
–the arrival rate ( the number of arrivals
per time unit) and
–the effective arrival rate (the number
of customers who arrive and enter the
system per time unit).
System Capacity Con’t
• Customers are allowed to enter the
system until space is available e.g.
cinema halls, restaurants, etc.

• Concert ticket sales for students, may


have unlimited capacity, on the number
of students allowed to wait 'to purchase
tickets.
EXAMPLE;
• In a sales department, the customer
orders are received without restriction

• 'customers′ demand 'service′ from some


facility any time.

• Usually the arrival of the customers and


the service times are assumed to be
random.
Applications of queuing theory
• Traffic flow (vehicles, aircraft, people,
communications),

• Scheduling (patients in hospitals, jobs on


machines, programs on computer), and

• Facility design (banks, post offices,


supermarkets).
Queuing Notation
• Recognizing the . of queuing
diversity systems, a
notational system was introduced in the 50’s
which has been widely adopted.
• The letters represent system characteristics based
on the format A/B/c/N/K where;
• A represents the inter-arrival time distribution
• B represents the service-time distribution
• C represents the number of parallel servers
• N represents the system capacity
• K represents the size of the calling population
Characteristics of queuing theory.
• A queuing system consists of a number of service
counters and interconnecting queues.

• Each service center consists of some number of


servers denoted by c, working in parallel; i.e. upon
getting to the head of the line, a customer takes
the first available server.

• Parallel service mechanisms are either single


server (c=1), multiple server (1<c<∞), or unlimited
servers (c=∞).
Characteristics of queuing theory.
• M/M/1/∞/∞(M/M/1). indicate a single-server
system that has unlimited queue capacity and
infinite population of potential arrivals.

• The inter-arrival times and service times are


exponentially distributed.

• When N and K are infinity, they may be dropped


from the notation.
• N represents the system capacity
• K represents the size of the calling population
Measures of Performance
• To assess the quality of a queuing system these
measures are used
• L: the average number of customers in the
system;
• w: the average time spent in the system;
• ρ: the server utilization; the proportion of
time that a server is busy.
system refers to the waiting line plus the
service mechanism, while the term queue
refers to the waiting line alone.
Quantitative Symbols and Notations

• n = Number of customers in the system (both


waiting and in service).
• λ = Average number of customers arriving per unit
of time.
• μ = Average number of customers being served per
unit of time.
• λ / μ = P, traffic intensity.
• C = Number of parallel service channels (i,e.,
servers).
• Ls = Average or expected number of customers in
the system (both waiting and in service).
Quantitative Symbols and Notations

• Lq = Average or expected number of customers in


the queue.
• Ws = Average waiting time in the system (both
waiting and in service).
• Wq = Average waiting time of a customer in the
queue.
• Pn = Time independent probability that there are n
customers in the system(both waiting and in
service).
• Pn(t) = Probability that there are n customers in the
system at any time (both waiting and in service).
PERFRMANCE MEASURES
Single Server Queue
• The central element of the system is a server,
which provides service to the connected
devices or items.

• Items request to the system to be served, if


the server is idle. Then, it is served
immediately, else it joins a waiting queue.

• After the task is completed by the server, the


item departs.
Single Server Queuing Assumptions:
• The arrivals follow Poisson distribution, with a
mean arrival rate λ=Average number of
customers arriving per unit of time.

• The service time has exponential distribution,


average service rate μ = Average number of
customers being served per unit of time.

• Arrivals are infinite population α. Customers are


served on a First-in, First-out basis (FIFO). There
System of Steady-state Equations
• The question arises whether the service can meet the
customer demand. This depends on the values of
average number of customers arriving per unit of
time(λ) and average number of customers being
served per unit of time(μ).

• If λ ≥ m (service rate) if arrival rate is greater than or


equal to the service rate, the waiting line would
increase without limit.

• Therefore for a system to work, it is necessary that λ


< μ(average number of customers being served per
queuing system
• Traffic intensity ρ = λ / μ

• The probability that the system is


idle or there are no customers in the
system, P0 = 1 – ρ.
Single Server Queue Problem
The grocery store problem.
Consider a scenario for 6 customers
Watch: https://www.youtube.com/watch?v=CUQ0vwOFSe4
• A small grocery store has only one checkout
counter.
• Customers arrive at the counter at random time
starting from 1 to 8 minutes apart.
• Each possible value of inter arrival time has the
same probability of occurrence.
• The service time vary from 1 to 6 minutes with
probabilities given as shown.
• The problem is to analyze the system by
simulating the arrival and service of 6 customers.
Use the following sequence of random
numbers
• Assume that the first customer
arrives at time 0.
calculate the arrival and service time table
and get the random number assignment
• probability=1/8=0.125
REDISTRIBUTION OF SERVICE TIME
Consider a Simulation for 100 customers
statistics
Single-server queuing identities
A. Number units in system = arrival rate * mean time in system

B. Number units in queue = arrival rate * mean time in queue

C. Mean time in system = mean time in queue + mean service


time

Note: Mean service time = 1/ mean service rate

If we can determine only one of the following, all other values can be
found by substitution:
Number units in system or queue
Mean time in system or queue
State diagram: single-server model
• Little’s Theorem in the context of
modeling and simulation.

L = λW,
• L is queue length
• λ is the average customer arrival rate
• W is delay in the system (wait) or the
average service time for a customer.
Important links
• https://www.youtube.com/watch?v=5q8z4Ik_c08
• https://www.youtube.com/watch?v=SqSUJ0UYWM
Q
• https://www.youtube.com/watch?v=r-z_veLmzYg
• https://www.youtube.com/watch?v=O46ZlKEjjHE
• https://www.youtube.com/watch?v=QppldN-t4pQ
A Markov Chain
• Is a case where future states of a process
are independent of the past and depend
only on the present .

• A Markov Chain is a random process


with the property that the next state
depends only on the current state. E.g.
Weather, stock market, genetics, product
success.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy