Sie sind auf Seite 1von 52

ISYS2088 Modelling & Simulation 20 January 2009

Lecture Notes

Opening Quotation

“By modeling various alternatives for future


system design, Federal Express has, in effect,
ISYS 2088 ModeIling and Simulation made its mistakes on paper. Computer modeling
Lecture 1 - Introduction
works; it allows us to examine many different
alternatives and it forces the examination of the
entire problem.”

Frederick W. Smith
Chairman and CEO of Federal Express Corporation

ISYS 2088 Modelling and Simulation 2/25

Managerial Approach to Decision Making The Modeling Process

Management
Situation Decisions Implementation Payoff
Analysis
Model Results

Interpretation
Symbolic World
Abstraction

Managerial
Judgement
Real World

Management Intuition
Situation Decisions

Source: Moore et al. (2001), Decision Modeling with Microsoft Excel, 6th ed. (Upper Saddle River, New Jersey: Source: Moore et al. (2001), Decision Modeling with Microsoft Excel, 6th ed. (Upper Saddle River, New Jersey:
Prentice Hall), Figure 1.1, p. 5. Prentice Hall), Figure 1.2, p. 5.

ISYS 2088 Modelling and Simulation 3/25 ISYS 2088 Modelling and Simulation 4/25

What is simulation? What is a system?

General Definition General Definition


• Simulation refers to a broad collection of methods and • A system is a facility or process, either actual or planned
applications to mimic the behaviour of real systems,
usually on a computer with appropriate software
Examples
• A manufacturing plant
Features
• A bank or other personal-service operation
• Aims to investigate a problem or to improve a system
• A computer network
• Uses a set of approaches and methods
• A freeway system
• Involves development of a model
• A restaurant
• Imitates a system on computer using software
• A supermarket, etc.

ISYS 2088 Modelling and Simulation 5/25 ISYS 2088 Modelling and Simulation 6/25

Page 1
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

What is a model? Why do we need to model a system?

General Definition • To measure its performance


• A model is an abstraction or a simplification of a system
• To improve its operation
and is used as a proxy for the system itself
• To help design it if it does not exist
Features
• Aims to represent a real system
• Can be very simple or very complex
• Involves assumptions
• Always bothered by the issue of model validity

ISYS 2088 Modelling and Simulation 7/25 ISYS 2088 Modelling and Simulation 8/25

Why can’t we ‘play’ with the system Advantages and disadvantages of


directly? modelling a system
• Too difficult and time consuming Advantages
• Too expensive • Relatively easy and quick to set up
• Less expensive
• Too dangerous
• Relatively safe
• Physically impossible • Flexible to change to test various options/scenarios
• Can answer many what-if questions to aid decision making

Disadvantages
• Requires knowledge of simulation and modelling skills
• Model differs from the real system and therefore may not be
valid

ISYS 2088 Modelling and Simulation 9/25 ISYS 2088 Modelling and Simulation 10/25

Other justifications for using models Types of models

Models force us to do the following: Physical (or Iconic) models


1. To be explicit about our objectives. • A physical model is a scale model or a physical
2. To identify and record the types of decisions that influence replica of a system
those objectives.
3. To identify and record
In short, models interactions
provide a and trade-offs among
framework
those decisions. Examples
for logical and consistent analysis of
4. To think carefully about variables to include and their
a problem orthat
situation. • Architectural model
definitions in terms are quantifiable.
5. To consider what data are pertinent for quantification of • Simulated control room of a nuclear power plant
those variables and determining their interactions. • Physical flight simulator
6. To recognize constraints (limitations) on the values that
those quantified variables may assume.
7. To communicate our ideas and understanding to facilitate
teamwork.
ISYS 2088 Modelling and Simulation 11/25 ISYS 2088 Modelling and Simulation 12/25

Page 2
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Types of models (cont’d) Types of models (cont’d)

Analog models Symbolic (or Logical / Mathematical) models


• An analog model represents a set of relationships • A symbolic or logical model is a set of
through a different, but analogous, medium approximations and assumptions, both structural
and quantitative, about the way a system works
Examples
• A highway road map (represents terrain) Examples
• A car’s speedometer (represents speed) • Regression model
• A pie chart (represents, say, cost components) • Inventory models such as EOQ model
• Gravity model
• Inflation lambda cold dark matter model

ISYS 2088 Modelling and Simulation 13/25 ISYS 2088 Modelling and Simulation 14/25

Merits of logical models What can we do with a logical model?

• Usually easy, cheap, and fast to get answers to a • If model is simple enough, use traditional
wide range of questions about the system that mathematics (queueing theory, differential
the model represents by simply manipulating the equations, linear programming) to get answers
program’s inputs and form − Nice in the sense that ‘exact’ answers to the model can be
obtained
• Can make mistakes on paper or the computer − But might involve many over-simplified assumptions in order
where they don’t count, rather than for real where to make the model analytically tractable hence the issue of
they do model validity

• Many complex systems require complex models


for realistic representation — simulation needed

ISYS 2088 Modelling and Simulation 15/25 ISYS 2088 Modelling and Simulation 16/25

The “Black Box” view of a model The three stages of building a model

1. Study the environment to frame the managerial


situation (into a problem statement).
Decisions Performance
Endogenous
Exogenous
Variables

Variables

(Controllable)
Model
Measure(s) 2. Formulate a selective representation (by
Parameters Consequence specifying the interactions among the variables).
(Uncontrollable) Variables
3. Construct a symbolic (quantitative) model.
How it works and how it generates
the results are not known

Source: Moore et al. (2001), Decision Modeling with Microsoft Excel, 6th ed. (Upper Saddle River, New Jersey:
Prentice Hall), Figure 1.4, p. 14.

ISYS 2088 Modelling and Simulation 17/25 ISYS 2088 Modelling and Simulation 18/25

Page 3
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

What is computer simulation? Advantages of simulation

• A method to develop and study a wide variety of • Flexible to model things as they are (even if
models of real-world systems things are messy and complicated)
− Use numerical evaluation on computer
− Use software to imitate the system’s operation and • Allows uncertainty, nonstationarity in modeling
characteristics, often over time
• Rapid advances in computer hardware and
• In practice, it is the process of designing and software → cheaper, quicker, and easier
creating computerized model of system and simulation
doing numerical computer-based experiments

• Real power is in modelling complex systems as


computer simulation tolerates complex models

ISYS 2088 Modelling and Simulation 19/25 ISYS 2088 Modelling and Simulation 20/25

Disadvantages of simulation Types of simulation

• Involve assumptions and therefore don’t get exact • Static vs. Dynamic
answers, only approximations and estimates − Does time have a role in the model?

• Errors might be introduced as a result of machine • Continuous-change vs. Discrete-change


roundoff − Can the ‘state’ change continuously or only at discrete points
in time?
• Get random output from stochastic simulations • Deterministic vs. Stochastic
with random input (RIRO) − Is everything for sure or is there uncertainty?

• The effect of randomness will propagate through • Most operational models are:
the model’s logic − Dynamic, Discrete-change, Stochastic

ISYS 2088 Modelling and Simulation 21/25 ISYS 2088 Modelling and Simulation 22/25

Using computers to simulate Using computers to simulate (cont’d)

• General-purpose languages (FORTRAN, C, C++, • Simulation languages (programming languages)


C#, Java, Matlab, others) − GPSS, SLX, SIMAN (on which simulation software Arena is
− Tedious, low-level, error-prone based, and is included in Arena)
− But, almost complete flexibility − Popular, general purpose, some are still in use
• Support packages − Learning curve for features, effective use, syntax

− Subroutines for list processing, bookkeeping, time advance • High-level simulators (tailor-made software)
− Widely distributed, widely modified − Very easy to use with graphical user interface (GUI)
• Spreadsheets − Domain-restricted (manufacturing, communications, video
game industry, computer animation, etc.)
− Usually used for static models
− Limited flexibility → model validity issues
− Financial scenarios, distribution sampling, etc.
− Narrow focus, e.g., high-resolution realistic animation only
ISYS 2088 Modelling and Simulation 23/25 ISYS 2088 Modelling and Simulation 24/25

Page 4
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Where simulation software Arena fits in Internet Resources for Simulation

• Hierarchical structure • Computer Simulation – Wikipedia, the free


− Multiple levels of encyclopedia
modeling
− http://en.wikipedia.org/wiki/Computer_simulation
− Can mix different
modeling levels together
in the same model • The Society for Modeling and Simulation
− Often, start high then go
Ch. 3 & 4
International (SCS) – Journal
lower as needed − http://sim.sagepub.com/
• Get ease-of-use Ch. 4, 7 & 8

advantage of • The Society for Modeling and Simulation


simulators without Ch. 5
International – Simulation Resources
sacrificing modeling − http://www.scs.org/resources.cfm
flexibility Ch. 10
25/25 ISYS 2088 Modelling and Simulation 26/25

Internet Resources for Simulation (cont’d) Class activity

• A Collection of Modelling and Simulation Resources • Do the quiz on basic concepts


on the Internet - by Andrea Emilio Rizzoli of modelling on pp. 2-3 of the
− http://www.idsia.ch/~andrea/simtools.html#libraries handout.

• Logistics Simulation • Try to complete the quiz all by


− http://www.logsim.co.uk/ yourself first. For those
questions you are not sure
• Simulation & Modeling Team – Table of Contents about the answers, discuss
− http://www.uh.edu/~lcr3600/simulation/contents.html with your classmates and see
why there are other views.

• Time for the quiz: 15 minutes


ISYS 2088 Modelling and Simulation 27/25 ISYS 2088 Modelling and Simulation 28/25

The system (as an example):


A simple part-processing system

ISYS 2088 Modelling and Simulation


Lecture 2 - Fundamental Concepts
• Logical structure of the model
− A first-in, first-out (FIFO) queue of parts feeds to a server

• Objectives
− To estimate expected production
− To estimate time in queue, queue length, proportion of time when
machine is busy

• Note
− To be consistent about the unit of time used
ISYS 2088 Modelling and Simulation 30/25

Page 5
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

The model (representing the system): Objectives of the study:


Assumption and numerical settings Output performance measures
• Assumption: Initially (at time 0) empty and idle • Total production of parts over the run (P)
• Time unit used: minute • Average waiting time of parts in queue:

∑ WQ
N
Part Number Arrival Time Interarrival Time Service Time N = no. of parts completing delay in queue
1 0.00 1.73 2.90
2 1.73 1.35 1.76 i WQi = waiting time in queue of i th part
3
4
3.08
3.79
0.71
0.62
3.39
4.52
i =1 Known: WQ1 = 0 (1st part experiences no delay)
5 4.41 14.28 4.46 N > 1 (at least one part in the queue)
6 18.69 0.70 4.36 N
7 19.39 15.52 2.07
8 34.91 3.15 3.36
9 38.06 1.76 2.37
10
11
39.82
40.82
1.00
.
5.38
.
• Maximum waiting time of parts in queue:
.
.
.
.
.
.
.
. max WQi
i =1,…, N
• Stop when 15 minutes of (simulated) time have passed
ISYS 2088 Modelling and Simulation ISYS 2088 Modelling and Simulation 32/25

Objectives of the study: Objectives of the study:


Output performance measures (cont’d) Output performance measures (cont’d)
• Time-average number of parts in queue:
• Utilization of the machine (proportion of time
15
Q(t) = number of parts in queue busy)
∫ Q(t ) dt at time t
0
15 15

• Maximum number of parts in queue: ∫ B(t ) dt ⎧1 if the machine is busy at time t


B(t ) = ⎨
max Q(t )
0 ⎩0 if the machine is idle at time t
0 ≤t ≤15 15

• Average and maximum flowtime of parts (time in • Other performance indicators


system, a.k.a. cycle time)

∑Pi =1Fi P , max Fi Fi = flowtime of i th part


i =1,…,P
ISYS 2088 Modelling and Simulation 33/25 ISYS 2088 Modelling and Simulation 34/25

Terminology:
Two types of statistics in simulation Components of a simulation model
∑ WQ
N

• Tallies i =1
i
• Entities
N − ‘Players’ that move around, change status, affect and are
affected by other entities
− Average queue time − Dynamic objects — Get created, move around, leave the
− Average cycle time 15 system

∫ Q(t ) dt − Usually represent ‘real’ things – physical entities


• In the example: entities are the parts
• Discrete-change (or time-persistent) 0
15 − Can have ‘fake’ or virtual or logical entities for modelling ‘tricks’
• Breakdown demon, break angel
− Average number in queue − Usually have multiple copies, or realisations, floating around
− Utilization of machine (or proportion of time machine is busy) − Can have different types of entities concurrently

ISYS 2088 Modelling and Simulation 35/25 ISYS 2088 Modelling and Simulation 36/25

Page 6
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Terminology: Terminology:
Components of a simulation model (cont’d) Components of a simulation model (cont’d)
• Attributes • (Global) Variables
− Characteristics of entities: used to describe or differentiate − Reflects a characteristic of the system, regardless of entities
− Different entities may have the same attributes but different − Each variable has only one copy for the whole model with
values, for example: unique name and value, for example:
• Time of arrival • Travel time between stations
• Due Date • Number of parts in system
• Priority • Simulation clock
• Color − Not tied to entities but entities can access and change variables
− Attribute value is tied to a specific entity − Some global variables are system-generated; some need to be
− Like ‘local’ (to entities) variables defined by modeller
− Many of the attributes need to be defined by modeller

ISYS 2088 Modelling and Simulation 37/25 ISYS 2088 Modelling and Simulation 38/25

Terminology: Terminology:
Components of a simulation model (cont’d) Components of a simulation model (cont’d)
• Resources • Queues
− They are what entities compete for, for example: − Place for entities to wait when they cannot move on
• People (perhaps it is because the resource they want to seize is not
• Equipment available)
• Space − Have names, often tied to a corresponding resource
− Entity seizes a resource, uses it, and releases it − Have finite capacity representing limited space — Have to
− Think of a resource as being assigned to an entity, rather model what to do if an entity arrives at a queue that’s already
than an entity belonging to a resource full
− A resource can represent a group of servers or units
− Usually the length of a queue or the waiting time in a queue
• Seats at a table in a restaurant is closely monitored in a model
• Identical ticketing agents at an airline counter
− The number of units of a resource can change during
simulation, e.g., lunch breaks, breakdowns
ISYS 2088 Modelling and Simulation 39/25 ISYS 2088 Modelling and Simulation 40/25

Terminology: Approaches to simulation:


Components of a simulation model (cont’d) The event-scheduling approach
• Statistical accumulators • Identify characteristic events which change state,
− Variables that ‘watch’ (or record) what’s happening e.g., arrival, departure, completion
− Depend on the types of output performance that the • Decide on the logic to effect state changes for each
modeller wishes to evaluate
event type; observe statistics
− ‘Passive’ in a model — No participation, just watching
− Many are automatically set up in a simulation software, but • Keep a simulation clock, a future event calendar
some need to be set up and maintained by the modeller • Jump from one event to the next; process event;
− At the end of the simulation, they are used to compute final observe statistics; update event calendar
output performance measures
• Set a stopping rule
• Usually done with general-purpose programming
language (e.g., C, FORTRAN, etc.)
ISYS 2088 Modelling and Simulation 41/25 42/25

Page 7
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Approaches to simulation: Issues in simulation:


The process-oriented approach Randomness in input and output
• Use a local instead of a global point of view • The example is just one run of the system i.e., a
• Focus on the processes that entities undergo sample size of one (not representative)
• Tell a story about what happens to a typical entity • Made a total of five runs or IID replications:
• Start with identifying characteristic entities in the
system
• May have many types of entities, virtual entities for
Note the
things like machine breakdowns substantial
• Multiple copies of entities can co-exist, interact, and variability
across
compete for resources replications
• Usually requires special simulation software
• Program codes are object-oriented, non-procedural • Confidence interval for the true mean
e.g., 95% c.i. on E(average time in queue): X ± tn −1,1−α / 2s / n
ISYS 2088 Modelling and Simulation 43/25 0 . 92 44/25
= 1 . 27 ± 2 . 776 , or 1 . 27 ± 1 .14
5

Comparing alternatives Results: Original vs. double-time arrival

• Usually, simulation is used for more than just a • Original – circles ( )


single model “configuration” • Double-time – triangles ( )

• Often want to compare alternatives, select or • Replication 1 – filled in ( , )


search for the best (via some criterion) • Replications 2-5 – hollow ( , )
• Note the variability of outcome
• For example, in the Simple processing system:
• Danger of making decisions
What would happen if the arrival rate were to
based on one (first) replication
double?
• Hard to see if there are really any
− Cut interarrival times in half differences even with five
− Rerun the model for double-time arrivals replications
− Make five replications • Need some statistical analysis of
simulation output data from
ISYS 2088 Modelling and Simulation 45/25
many replications 46/25

Simulation using spreadsheets: Simulation using spreadsheets:


Overview Newsvendor problem - setup
• A popular and ubiquitous tool • Newsvendor sells newspapers on the street
− Buys for c = $0.55 each, sells for r = $1.00 each
• Can use for simple simulation models
• Each morning, buys q copies from the printer
− Typically used for static models
− q is a fixed number, same every day
− Also used for risk analysis, financial/investment scenarios
• Demand during a day: D = max (⎣X⎤, 0) where ⎣X⎤
• Add-ins – @RISK, Crystal Ball rounds X to nearest integer
− Only the simplest of dynamic models − X ~ normal (μ = 135.7, σ = 27.1), from historical data
• Examples • If D ≤ q, satisfy all demand, and q – D ≥ 0 left over,
sell for scrap at s = $0.03 each
− Newsvendor problem
• If D > q, sells out (sells all q copies), no scrap but
− Waiting times in single-server queue
missed out on D – q > 0 sales
• Inadequate tool for dynamic simulations if there’s
any complexity • Question: What should q be?
ISYS 2088 Modelling and Simulation 47/25 ISYS 2088 Modelling and Simulation 48/25

Page 8
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Simulation using spreadsheets: Simulation using spreadsheets:


Newsvendor problem - formulation Newsvendor problem - simulation
• Choose q to maximize expected profit per day • Steps: Set trial value of q, generate demand D,
− q too small – sell out, miss $0.45 profit per paper compute profit for that day
− q too big – have left over, scrap at a loss of $0.52 per paper − Then repeat this for many days independently, average to
• Classic operations-research problem estimate E(W(q))
• Also get confidence interval, estimate of P(loss), histogram of
− Many versions, variants, extensions, applications W(q)
− Much research on exact solution in certain cases
− Try for a range of values of q
− But easy to simulate, even in a spreadsheet
• Need to generate demand D = max (⎣X⎤, 0)
• Profit in a day, as a function of q:
− That is, generate X ~ normal (μ = 135.7, σ = 27.1)
W(q) = r min (D, q) + s max (q – D, 0) – cq − In mathematical terms, generate X = Φμ,σ(U)
Sales revenue Scrap revenue Cost U is a random number distributed uniformly on [0, 1]
Note: W(q) is a random variable – profit varies from day to day Φμ,σ is cumulative distribution function of normal (μ, σ) distribution
• Objective: Maximize E(W(q)) over non-negative
integers q
ISYS 2088 Modelling and Simulation 49/25 ISYS 2088 Modelling and Simulation 50/25

Simulation using spreadsheets: Simulation using spreadsheets:


Newsvendor problem - Excel Newsvendor problem - Excel (cont’d)
• File Newsvendor.xls • For each q:
− “Sold” column: number of papers sold that day
• Input parameters in cells B4 – B8 (blue)
− “Scrap” column: number of papers scrapped that day
• Trial values for q in row 2 (pink) − “Profit” column: profit (+, –, 0) that day
$ pins down following
• Day number (1, 2, ..., 30) in column D column or row when • At bottom of “Profit” columns (green):
• Demands in column E for each day: copying − Average profit over 30 days
• = MAX(ROUND(NORMINV(RAND(), $B$7, $B$8), 0), 0) − Half-width of 95% confidence interval on E(W(q))
• Half-width = tn-1,1-α/2 s / √n where α = 0.05; in this case, t29, 0.975 = 2.045
Rounding Φ 1 U(0, 1) μ σ • Value 2.045 is upper 0.975 critical point of t distribution with 29 d.f.
function random number MAX 2nd • Plot confidence intervals as “Ι-beams” on left edge

X ~ normal (μ, σ)
argument − Estimate of P(W(q) < 0)
RAND() is “volatile” • Ratio of number of days of making a loss to 30 (days in a month)
so regenerates on
any edit, or F9 key
Round to • Histograms of W(q) at bottom
nearest
integer − Vertical red line at 0, separates profits, losses
ISYS 2088 Modelling and Simulation 51/25 ISYS 2088 Modelling and Simulation 52/25

Simulation using spreadsheets: Simulation using spreadsheets:


Newsvendor problem - results Single server queue - setup
• Note: we used same daily demands (column E) for each day • Like hand simulation, but
across all trial values of q just to reduce variance
− Inter-arrival times ~ exponential with mean 1/λ = 1.6 min.
− Would have been valid to generate demand independently
− Service times ~ uniform on [a, b] = [0.27, 2.29] min.
− Fixed demand for all q attributes all the differences in profit to q
− Stop when 50th waiting time in queue is observed
• Results • i.e., when 50th customer begins service, not exits system
− Best q is about 140, maybe a little less
• Watch waiting times in queue WQ1, WQ2, ..., WQ50
− Randomness in all the results (tap F9 key)
• All demands, profits, graphics change
− Important – not watching anything else, unlike before
• Confidence-interval, histogram plots change • Si = service time of customer i,
• Reminder that these are random outputs, random plots Ai = inter-arrival time between customers i – 1 and i
− Higher q ⇒ more variability in profit
• Histograms at bottom are wider for larger q • Lindley’s recursion (1952): Initialize WQ1 = 0,
• Higher chance of both large profits, but higher chance of loss, too WQi = max (WQi – 1 + Si – 1 – Ai, 0), i = 2, 3, ...
• Risk/return trade-off can be quantified – risk taker vs. risk-averse

ISYS 2088 Modelling and Simulation 53/25 ISYS 2088 Modelling and Simulation 54/25

Page 9
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Simulation using spreadsheets: Simulation using spreadsheets:


Single server queue - simulation Single server queue - results
• Need to generate random variates: let U ~ U[0, 1] • Column averages (green)
− Exponential (mean 1/λ): Ai = –(1/ λ) ln(1 – U) − Average inter-arrival, service times close to expectations
− Uniform on [a, b]: Si = a + (b – a) U − Average WQi within each replication
• Not too far from the steady-state expected wait in queue E(WQ∞)
• File MU1.xls E(WQ∞) = λ(Var(Si) + (E(Si))2) / 2(1 - λE(Si))
• Input parameters in cells B4 – B6 (blue) • Considerable variation
• Many are below it because of positive autocorrelation between WQi’s
• Customer number (i = 1, 2, ..., 50) in column D
• Cross-replication (by customer) averages (green)
• Five IID replications (three columns for each) − Column T, thick line in plot to dampen noise
− IA = inter-arrival times, S = service times • Why no sample variance, histograms of WQi’s?
− WQ = waiting times in queue (plot, thin curves)
− Could have computed both, as in newsvendor
• First one initialized to 0, remainder use Lindley’s recursion
– Curves rise from 0, variation increases toward right − Nonstationarity – what is a “typical” WQi here?
• Creates positive autocorrelation down the WQ columns − Autocorrelation – biases variance estimate, may bias histogram if
– Curves have less abrupt jumps than if WQi’s were independent run is not “long enough”
ISYS 2088 Modelling and Simulation 55/25 ISYS 2088 Modelling and Simulation 56/25

Simulation using spreadsheets: Simulation using spreadsheets:


Exercise – Order for Land’s End (1) Exercise – Order for Land’s End (2)
• Land’s End is a mail-order firm that sells apparel. It • Toward the end of the winter season, Land’s End
faces uncertain demand and has to make decisions sends out a sales catalogue with discounted prices
regarding the number of catalogues to print and mail, on unsold items. The discounted price determines
the number of units of each product to order, and the the demand in response to the sales catalogue.
contracts to enter into with its suppliers. The general The manager anticipates that the sales catalogue
manager at Lands’ End wants to evaluate different will generate demand for cashmere sweaters with a
policies before implementing them. mean of 1000 – 5p and a standard deviation of
(1,000 – 5p)/3, where p is the discounted price
• Lands’ End plans to sell cashmere sweaters in its charged. Any leftover sweaters after the sales
winter catalogue for $150 each. The manager expects catalogue are donated to charity. Each sweater
demand to be normally distributed, with a mean of μ costs Lands’ End $50.
= 3,000 and a standard deviation of σ = 1000.
ISYS 2088 Modelling and Simulation 57/25 ISYS 2088 Modelling and Simulation 58/25

Simulation using spreadsheets:


Exercise – Order for Land’s End (3) Overview of a simulation study
• The donation to charity fetches $25 in tax benefits. • Understand the system
Lands’ End incurs a cost of $5 per unsold sweater • Be clear about the objectives
to store and transport to charity, resulting in a
• Formulate the model representation
salvage value of s = $20 per sweater sent to
charity. • Translate into modelling software
• Verify that the computer representation is correct
• The manager has decided to charge a discount • Validate the model
price of max($25, $150 – n/20), where n is the
• Design the experiments
number of sweaters left over after the winter sales
catalogue. The manager wants to determine the • Run the experiments
number of sweaters that should be purchased at • Analyze results; get insight; document everything
the start of the winter season.
ISYS 2088 Modelling and Simulation 59/25 ISYS 2088 Modelling and Simulation 60/25

Page 10
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Stages of a simulation study Stages of a simulation study (cont’d)


Stage 1 - Problem formulation Stage 3 - System and simulation specification
− Define and formulate the problem − Develop specification for the model with the clients
− Set system boundaries − Should cover areas such as:
− Understand the system and its size, the performance metrics, • Simulation objectives
and the expectations of the clients • System description and modelling approach
• Level of detail required
• Degree of flexibility
Stage 2 - Solution methodology • Number of scenarios considered
− Identify all possible solution methodologies • Animation exactness
− Select the most appropriate method, e.g., simulation • Model input and output
• Major milestones
• Project deliverables and timetable

ISYS 2088 Modelling and Simulation 61/25 ISYS 2088 Modelling and Simulation 62/25

Stages of a simulation study (cont’d) Stages of a simulation study (cont’d)


Stage 4 - Model formulation and construction Stage 6 - Experimentation and Analysis
− Determine modelling approach (high-level vs. low-level) − Experiment with model for scenario analysis
− Partition construction into different phases for large model − Three types of analysis during different stages of development:
• Candidate analysis - Identify the best candidate system
• Comparative analysis - Compare and select the best design
Stage 5 - Verification and Validation
• Predictive analysis - Use the best system to estimate performance
− Debug model with test runs
− Validate model by comparing modelled results with real data
− Verify model with the clients
Stage 7 - Presenting and Preserving the Results
− Prepare technical reports and other documents
− Preserve results throughout the project as part of the
documentation process

ISYS 2088 Modelling and Simulation 63/25 ISYS 2088 Modelling and Simulation 64/25

A review of basic statistics A review of basic statistics (cont’d)

Probability basics Probability basics (cont’d)


− The probability of an event E, denoted by P(E), is the relative − The conditional probability of E given F is defined as P(E | F) =
likelihood that the event will occur in an experiment. P(E ∩ F) / P(F) assuming that P(F) > 0. It means that knowing
− Probabilities are always between 0 and 1. that F occurred reduces the ‘world’ from the whole sample
space down to F, and so the only relevant part of E is that part
− If S is the entire sample space, then P(S) = 1.
interacts with F. This probability is measured relative to the
− If Ø is the empty (null) event, then P(Ø) = 0. ‘size’ of the reduced world, P(F).
− P(E’) = 1 – P(E) where E’ is the complement of E. − Events E and F are called independent if P(E | F) = P(E), and
− P(E ∪ F) = P(E) + P(F) – P(E ∩ F). P(F | E) = P(F), by definition of conditional probability. It means
− If E and F are mutually exclusive (E ∩ F = Ø), then P(E ∪ F) = that knowing that one of the two independent events has
P(E) + P(F). occurred gives no information on whether the other one will
occur or not.

ISYS 2088 Modelling and Simulation 65/25 ISYS 2088 Modelling and Simulation 66/25

Page 11
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

A review of basic statistics (cont’d) A review of basic statistics (cont’d)

Random variables Sampling and sampling distribution


− A random variable is a number whose value is determined by − A population is the totality of items or things under
the outcome of an experiment. consideration, e.g., all males.
− Technically, a random variable is a function defined from the − A sample is the portion of the population that is selected for
analysis, e,g, all males under 25.
sample space to the real numbers. As such, it’s a rule of
mapping that assigns a number to each possible outcome of the − A simple random sample is one in which every item has the
same probability of being selected, and the selection of one item
experiment.
does not affect the probability of selection of another item.
− A discrete random variable can take on only certain separated − A parameter is a summary measure that is computed to
values, e.g., integers. Its range of value can be finite or infinite. describe a characteristic of the entire population.
− A continuous random variable can take on any (or infinite) real − A statistic is a summary measure that is computed to describe a
value, possibly bounded on the left or right, e.g., [0, ∞). characteristics from only a sample of the population.

ISYS 2088 Modelling and Simulation 67/25 ISYS 2088 Modelling and Simulation 68/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Sampling and sampling distribution (cont’d) Sampling and sampling distribution (cont’d)
− The mean of a sample {x1, x2, x3, …, xn} − The standard deviation of a sample {x1, x2, x3, …, xn}
(a measure of central tendency) (also a measure of variation or spread)
_ n _
n
x = ∑ xi / n
i=1
s = √ { ∑ (xi – x)2 / (n – 1)}
i _
− The variance of a sample {x1, x2, x3, …, xn}
− The sample mean and standard deviation are represented by x
(a measure of variation or spread)
and s.
n _
− The population mean and standard deviation are represented by
s2 = ∑ (xi – x )2 / (n – 1)
i=1
μx and σx.

ISYS 2088 Modelling and Simulation 69/25 ISYS 2088 Modelling and Simulation 70/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Sampling and sampling distribution (cont’d) Sampling and sampling distribution (cont’d)
− If all possible samples from a population are selected, the − Confidence interval estimation of the mean (σx known)
distribution of the results (e.g., sample means) is referred to as a
sampling distribution. _
− Standard error of the mean (when sampling with replacement) is μx = x ± Z (σx / √n) where Z follows the standardised
a measure of the variability of the mean from sample to sample: normal distribution
σx’ = σx / √n where σx is the s.d. of the sampling distribution
− Central Limit Theorem: As the sample size (number of − Confidence interval estimation of the mean (σx unknown)
observations in each sample) gets larger enough (≥ 30), the
sampling distribution can be approximated by the normal _
distribution. This is true regardless of the shape of the μx = x ± tn - 1 (s / √n) where t follows the Student’s t
distribution of the individual values in the population.
distribution with d.f. = n - 1

ISYS 2088 Modelling and Simulation 71/25 ISYS 2088 Modelling and Simulation 72/25

Page 12
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Example Example (cont’d)
− Suppose that the packaging equipment in a manufacturing − Since σx is known, we estimate the confidence interval of μx
process that is filling 368-gram boxes of cereal is set so that the _
amount of cereal in a box is normally distributed with a mean of
368 grams. From past experience, the population standard using the formula μx = x ± Z (σx / √n)
deviation for this filling process is known to be 15 grams. To At 95% confidence interval, Z = 1.96
check whether the equipment is working to specifications, the μx = 362.3 ± 1.96 (15 / √ 25)
production manager randomly selected a sample of 25 boxes = 362.3 ± 5.88
and found that the mean weight is 362.3 grams.
or 363.62 ≤ μx ≤ 368.18
_
Since the true population mean 368 grams falls within this
x = 362.3; σx = 15 interval, the production manager may conclude with 95%
n = 25 confidence that the packaging equipment is working properly.

ISYS 2088 Modelling and Simulation 73/25 ISYS 2088 Modelling and Simulation 74/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)

Another example Another example (cont’d)


− Suppose that the marketing manager for the water authority − Since σx is unknown, we estimate the confidence interval of μx
wants to estimate the average annual usage (in gallons) of _
single-family homes in a particular geographical area. A using the formula μx = x ± tn - 1 (s / √n)
random sample of 35 single-family homes was selected and the At 95% confidence interval and d.f. = n - 1 = 34, t34 = 2.0322
annual usage of these homes was found to have a mean of μx = 1122.7 ± 2.0322 (295.72 / √ 35)
1122.7 gallons and a standard deviation of 295.72 gallons.
= 11222.7 ± 101.58
_
or 1021.12 ≤ μx ≤ 1224.28
x = 1122.7 s = 295.72 The marketing manager may conclude with 95% confidence that
n = 35 the average amount of water consumed per year is between
1021.12 and 1224.28 gallons.

ISYS 2088 Modelling and Simulation 75/25 ISYS 2088 Modelling and Simulation 76/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Another example (cont’d) Hypothesis testing
− The 95% confidence interval states that we are 95% sure that − Hypothesis-testing methodology is designed so that the
the sample we have selected is one in which the population rejection of the null hypothesis is based on evidence from the
mean μx is located within the interval. This 95% confidence sample that the alternative hypothesis is far more likely to be
actually means that if all possible samples of size 35 were
selected (something that would never be done in practice), 95% true.
of the intervals developed would include the true population − A null hypothesis (H0) is always one of the status quo or no
mean somewhere within the interval. A particular sample may difference. It is always the one to be tested.
contain extreme values (i.e, outliers) which can affect the value − An alternative hypothesis (H1) is one must be true if the null
of the sample mean so that it deviates very much from the
population mean. But on average, the effect is reduced. Also hypothesis is found to be false. It represents the conclusion that
by increasing the sample size, the standard error of the mean would be reached if there were sufficient evidence from sample
can also be reduced. The effect of extreme values gets smaller. information to decide that the null hypothesis is unlikely to be
true and therefore should be rejected.

ISYS 2088 Modelling and Simulation 77/25 ISYS 2088 Modelling and Simulation 78/25

Page 13
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Hypothesis testing (cont’d) Example
− Type I error occurs if the null hypothesis H0 is rejected when in − Going back to the cereal box filling example, the production
fact it is true and should not be rejected. manager hypothesises that the packaging equipment is working
to specifications. He sets the level of significance to 0.05 and
− Type II error occurs if the null hypothesis H0 is not rejected takes a random sample of 25 boxes. Suppose that the sample
when in fact it is false and should be rejected. indicates a sample a mean of 372.5 grams and the population
standard deviation remains at 15 grams.
− The level of significance is the probability of committing a Type I H0 : μx = 368
error, denoted by α, and is traditionally set to 0.05 or smaller.
H1 : μx≠ 368
− The p value is the probability of obtaining a test statistic equal to _
or more extreme than the results obtained from the sample x = 372.5 σx = 15
data, given that the null hypothesis H0 is true. If the p value is n = 25
greater than or equal to α, H0 is not rejected. If the p value is
small than α, H0 is rejected.
ISYS 2088 Modelling and Simulation 79/25 ISYS 2088 Modelling and Simulation 80/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)


Example (cont’d) Example (cont’d)
− Since σx is known, based on the central limit theorem the − At α = 0.05 (or 95% level of significance) and for a two-tailed
sampling distribution of the mean would follow the normal test, Z = 1.96, therefore the decision rule would be
distribution. The Z-test statistic can be calculated using Reject H0 if Z > +1.96 or if Z < -1.96;
_ otherwise do not reject H0.
Z = (x - μx) / (σx / √n) _
Z = (x - μx) / (σx / √n) = (372.5 - 368) / (15 / √ 25) = +1.50
In this formula, the numerator measures how far (in an absolute Since Z = +1.50, we see that -1.96 < +1.50 < +1.96. Therefore,
sense) the observed sample mean is from the hypothesised the production manager may decide not to reject H0. That is to
mean. The denominator is the standard error of the mean, so Z say, the average amount filled is 368 grams and the equipment
represents how many standard errors the sample mean is from is working to specifications. To take into account a Type II
the hypothesised value. error, he may phrase the conclusion as ‘there is no evidence
that the fill is different from 368 grams.’
ISYS 2088 Modelling and Simulation 81/25 ISYS 2088 Modelling and Simulation 82/25

A review of basic statistics (cont’d) A review of basic statistics (cont’d)

Steps of hypothesis testing Steps of hypothesis testing (cont’d)


− State the null hypothesis, H0. − Collect the data and compute the sample value of the
− State the alternative hypothesis, H1. appropriate test statistic.
− Determine whether it is a one-tailed or two-tailed test. Usually, − Determine whether the test statistic has fallen into the rejection
= and ≠ is two-tailed; ≤ and > or ≥ and < is one-tailed. or the non-rejection region.
− Choose the level of significance, α. − Make the statistical decision.
− Choose the sample size, n. − Express the statistical decision in terms of the problem.
− Determine the appropriate statistical technique and
corresponding test statistic to use, e.g., Z-test, t-test, χ2 test.
− Set up the critical values that divide the rejection and non-
rejection regions of the probability density function.

ISYS 2088 Modelling and Simulation 83/25 ISYS 2088 Modelling and Simulation 84/25

Page 14
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Class activity Basic statistics exercise no. 1


• Divide the class into groups 1. Two events A and B are such that P(A) = 0.6, P(B) =
and work on the exercises of 0.4 and P(A∩B) = 0.3. Evaluate P(A∪B) and P(A⏐B').
basic statistics (Q.1 – Q.4) on
page 1 of the handout.

• Discuss with your group


members at will so as to
ensure your understanding of
questions and their solutions.

• Students may be required to


present their proposed
solutions in class.
ISYS 2088 Modelling and Simulation 85/25 ISYS 2088 Modelling and Simulation 86/25

Solution to the statistics exercise 1 Basic statistics exercise no. 2

2. The following times represent the time in minutes


that a student spent on the Internet on each day in a
particular month of 30 days:

27 42 35 16 24 52 46 49 36 40
37 35 39 43 41 47 44 50 23 31
19 31 47 53 29 42 48 33 30 28

Estimate the median, mean, variance, and standard


deviation of the distribution.

ISYS 2088 Modelling and Simulation 87/25 ISYS 2088 Modelling and Simulation 88/25

Solution to the statistics exercise 2 Solution to the statistics exercise 2 (cont’d)


_
Solution n

Variance: s2 = ∑ (xi – x)2 / (n – 1)


Arrange the data in ascending order first: i

16, 19, 23, 24, 27, 28, 29, 30, 31, 31, 33, 35, 35, 36, 37, = {(16 - 37.2)2 + (19 - 37.2)2 + ... + (53 – 37.2)2} /
39, 40, 41, 42, 42, 43, 44, 46, 47, 47, 48, 49, 50, 52, 53 (30 - 1)
= 99.2885
Median = (n + 1) / 2th item = 15.5th item = 38 _
n
_ n Standard Deviation: s = √ { ∑ (xi – x)2 / (n – 1)} = √s2
Mean: x = ∑ xi / n = (16 + 19 + 23 + … + 52 + 53) / 30 = 37.2333 i

i=1
= √ 99.2885 = 9.9644

ISYS 2088 Modelling and Simulation 89/25 ISYS 2088 Modelling and Simulation 90/25

Page 15
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Basic statistics exercise no. 3 Basic statistics exercise no. 3 (cont’d)

3. Suppose that the manager of a paint supply store a. Set up a 99% confidence interval estimate of the
wanted to estimate the correct amount of paint true population average amount of paint included in
contained in one-gallon cans purchased from a a one-gallon can. (At 99% c.i., Z = 2.675.)
nationally known manufacturer. It is known from b. Based on your results, do you think that the
the manufacturer’s specifications that the standard storeowner has a right to complain to the
deviation of the amount of paint is equal to 0.02 manufacturer? Why?
gallon. A random sample of 50 cans is selected, c. Does the population amount of paint per can have
and the average amount of paint per one-gallon can to be normally distributed here? Explain.
is 0.995 gallon. d. Tell why an observed value of 0.98 gallon for an
individual can would not be unusual, even though it
is outside the confidence interval you calculated.

ISYS 2088 Modelling and Simulation 91/25 ISYS 2088 Modelling and Simulation 92/25

Solution to the statistics exercise 3 Solution to the statistics exercise 3 (cont’d)


a. Set up a 99% confidence interval estimate of the true population b. Based on your results, do you think that the storeowner has a
average amount of paint included in a one-gallon can. right to complain to the manufacturer? Why?
Answer Answer
Since σx is known, we estimate the confidence interval of μx Since the value of 1.0 (i.e., one gallon) is included in the
_ interval, there is no reason to believe that the average is below
using the formula μx = x ± Z (σx / √n) 1.0.

At 99% confidence interval, Z = 2.675


μx = 0.995 ± 2.675 (0.02 / √ 50)
= 0.995 ± 0.008
or 0.987 ≤ μx ≤ 1.003

ISYS 2088 Modelling and Simulation 93/25 ISYS 2088 Modelling and Simulation 94/25

Solution to the statistics exercise 3 (cont’d) Solution to the statistics exercise 3 (cont’d)
c. Does the population amount of paint per can have to be d. Tell why an observed value of 0.98 gallon for an individual can
normally distributed here? Explain. would not be unusual, even though it is outside the confidence
interval you calculated.
Answer
No, since σx is known and n = 50, from the central limit theorem Answer
_ An individual value of 0.98 is only 0.75 standard deviation
we may assume that x is normally distributed regardless of the below the sample mean of 0.995 [(0.98 – 0.995)/0.02 = -0.75].
distribution of the population. This amount of deviation from the mean for an individual data
point is quite common. The confidence interval represents the
estimate of average of a sample of 50, not an individual value.
If we take a sample of 50 cans and the average is 0.98, that’s
another story.

ISYS 2088 Modelling and Simulation 95/25 ISYS 2088 Modelling and Simulation 96/25

Page 16
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Basic statistics exercise no. 4 Basic statistics exercise no. 4 (cont’d)

4. A task on an assembly line has, in the past, required a. Is there evidence to suggest that the mean time
30 seconds to complete. An industrial engineer has under the new method is significantly less than 30
developed a new method for performing the task seconds? (Use α = 0.05; t(.05, 14) = -1.7613)
that she believes will speed up the process. A b. What would you recommend to the management
random sample of 15 workers trained under the new concerning the new method?
method is selected and the time they needed to
complete the task is recorded as shown below:

27.2 31.1 29.0 26.7 28.1 27.3 29.6 30.5


30.0 30.2 35.9 31.3 28.8 27.4 27.0

ISYS 2088 Modelling and Simulation 97/25 ISYS 2088 Modelling and Simulation 98/25

Solution to the statistics exercise 4 Solution to the statistics exercise 4 (cont’d)


a. Is there evidence to suggest that the mean time under the new method
is significantly less than 30 seconds? (Use α = 0.05.) At α = 0.05 (or 95% level of significance) and for a one-tailed
test, t(.05, 14) = -1.7613, therefore the decision rule would be:
Answer
H0 : μx = 30
Reject H0 if the calculated t < t(.05, 14);
H1 : μx < 30 ⇒ one-tailed test
otherwise do not reject H0.
_
_
x = 28.67 s = 1.724
n = 15 t = (x - μx) / (s / √n) = (28.67 - 30) / (1.724 / √ 15) = -2.9879

Since σx is not known, t-test has to be used. The t-test statistic


Since t = -2.9879 < t(.05, 14) = -1.7613. Therefore, reject H0.
can be calculated using
There is evidence that the mean time is less than 30 seconds.
_
t = (x - μx) / (s / √n)
ISYS 2088 Modelling and Simulation 99/25 ISYS 2088 Modelling and Simulation 100/25

Solution to the statistics exercise 4 (cont’d)


b. What would you recommend to the management concerning
the new method?
ISYS 2088 Modelling and Simulation
Answer Lecture 3 – An Overview of Arena
If it is cost efficient, the new method should be implemented.

ISYS 2088 Modelling and Simulation 101/25

Page 17
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Basic interaction Basic interaction (cont’d)


• Arena (v. 10): A true Windows application • Miscellaneous functions
− Supports usual operations of mouse and keyboard: selecting, − Object-oriented: select an object and then act on it
dragging, resizing, menus, buttons, folder tabs − Undo/Redo
− Supports usual window operations — resize, reposition, layer, − Right (secondary) mouse button
maximize, minimize, close • to repeat last action
• Windows file operations • to bail out of current action
− New, Open, Save, Save As, Print, Print Preview − Drawing: hold Shift key to constrain lines to horizontal or
vertical, rectangle to square, ellipse to circle, etc.
• Cut/Copy/Paste
− To cycle among open Arena windows: Ctrl+Tab
− Within an Arena window
− To duplicate selection: Ctrl+D to duplicate, then move and
− Between Arena windows edit duplicated object
− Between Arena and other application windows (if necessary)

ISYS 2088 Modelling and Simulation 103/25 ISYS 2088 Modelling and Simulation 104/25

Menus File menu


• Total nine menus: File, Edit, View, Tools, Arrange, • New, Open..., Save, Save As...
Object, Run, Window, and Help
• Template Panel: Attach…, Depatch template panel
• Standard operations for Windows menus − Attach (a new panel e.g., AdvancedTransfer.tpo to model
− File menu has Open, Save, Save As, etc. window)
− Edit menu has Cut, Copy, Paste, etc. − Detach (an opened panel from model window even if model
− Help menu has Arena Help, What’s This?, Release Notes, has used modules from it)
Arena SMART files, etc.
• Many menu items also come with toolbar buttons,
some with shortcut function keys and hot keys

ISYS 2088 Modelling and Simulation 105/25 ISYS 2088 Modelling and Simulation 106/25

File menu (cont’d) Edit menu

• DXF Import: Imports CAD DXF file for ‘backdrop’ • Undo/Redo


• Open Color palette, Save Color palette • Cut, Copy, Paste
• Paste Link (OLE link)
• Print…, Print Preview, Print Setup…
• Duplicate, Delete selected object
• Send model file (.doe) as attachment via e-mail • Select All, Deselect All objects
• List of recent model files opened • Entity Pictures…, Calendar Schedules
• Exit Arena • Find — Searches through all modules in the
current model for a text string
• Properties — Edits properties of the model file
• Links — Edits links to other documents if exist
• Objects — Edits embedded objects in the model
ISYS 2088 Modelling and Simulation 107/25 ISYS 2088 Modelling and Simulation 108/25

Page 18
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

View menu Tools menu


• Zoom In ( + ), Zoom Out ( - ), Zoom Factor • Arena Symbol Factory — Useful for creating different
• Named Views types of symbols for model animation
− Pre-defined by Arena ( * ) or user • Separate applications for building Arena model and
− Displays defined views (using hot keys such as m, a) analysing results
• Grid, Snap, Grid Settings — Controls the − Input Analyzer
placement of modules
− Process Analyzer
• Layers — Determines what model objects show up in what
manner • Tools to import and export data to other applications
• Toolbars — Determines what button collections show up − FactoryAnalyzer, ContactCenter, etc.

• Status Bar (check, uncheck) — Shows state of operation, • Macro — To record and run macros
coordinates of cursor • Options… — Controls how Arena works and looks
ISYS 2088 Modelling and Simulation 109/25 ISYS 2088 Modelling and Simulation 110/25

Arrange menu Object menu

• For drawing objects • Connection controls


• Bring selected object to Front, Send it to − Connect links two modules together using a line
Back — For ‘stacking’ effects segment
− Auto-Connect links newly placed module to a selected
• Group, Ungroup objects module automatically — toggle on/off
• Flip object around Vertical or Horizontal line − Smart Connections insert new connections in several
horizontal and vertical segments rather than just one
• Rotate object diagonal segment — toggle on/off
• Snap selected object to Grid − Animate Connectors animates the flow of entities
along the connectors — toggle on/off
• Change Snap Point — For snapping objects
in different ways

ISYS 2088 Modelling and Simulation 111/25 ISYS 2088 Modelling and Simulation 112/25

Run menu Window menu


• Go, Step, Fast-Forward, Pause, Start-Over, End — • Cascade,Tile — Functions for arranging multiple
Commands to run model and to pause, step through, end opened model windows
operation
• Check Model, Review Errors, Run Control — • Arrange Icons — Function for re-aligning
Alternatives to check model before running, view errors and minimized model windows
control how the model is run
• Use System Background Color — Function to use
• Command, Break, Watch — Functions to watch closely Windows colours rather than Arena settings
model execution
• Break on Module, Highlight Active Module — • List of currently opened model windows
Controls how the run goes and is monitored
• SIMAN, Command — Provides low-level control to model
running

ISYS 2088 Modelling and Simulation 113/25 ISYS 2088 Modelling and Simulation 114/25

Page 19
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Help menu Toolbars

• Arena Help — Contents, Index, Search • Collections of buttons for quick access to activities
− Most (not all) of them are proxies of menu items
• What’s This? — Object specific help information
• 10 Toolbars: Standard, Draw, Animate, Integration,
• Arena SMART files — A collection of small example View, Arrange, Run Interaction, Record Macro,
models that demonstrate a variety of modeling Animate Transfer, and Professional
techniques and situations commonly encountered
• View/Toolbars (or right-click in a toolbar area) to
using Arena decide which ones to show up or hide
• Basic Process Panel — Used for model building and • Toolbars can be placed anywhere (i.e., ‘floating’), or
consists of 8 flowchart modules and 6 data modules ‘docked’ to an edge of screen
• Advanced Process Panel — Used for more • Arena remembers new Toolbar configuration during
complicated model building and consists of 13 next startup
flowchart modules and 7data modules
115/25 ISYS 2088 Modelling and Simulation 116/25

Help system Model window

• An extensive and comprehensive online system — • Where a model is built, edited, and run on Arena
Replaces traditional manuals • Can have several model windows opened at the
same time
• Interlinked via hypertext for cross referencing
• A ‘window’ shows just a portion of the underlying
• Multiple entry points, including Help menu ‘world’ — (x, y) coordinates in world units
• Button for context-sensitive help • Open… — Displays an existing model (.doe)
• button appears in many dialogs • New — Creates a new (blank) model window
• button (What’s This?) for information on an item • Save, Save As…, Send
• Tool tips — To activate, leave mouse motionless on • To add modelling construct, just click from a panel
an item until a little yellow label appears template and drop module into window

ISYS 2088 Modelling and Simulation 117/25 ISYS 2088 Modelling and Simulation 118/25

Drawing Printing
• Draw via toolbar buttons only (no menu): • Can print directly from Arena
• Supports color printing
• Line, Polyline (hold Shift key for constrained
drawing), Arc, Bezier Curve • Can have many pages for big models
• Box, Polygon, Ellipse (fill, line, shade) • Can also print any Named Views separately
• Text (font, size, style, color) − Use Print Preview to select the desired page before printing

• Visible/Hidden setting — Shows or hides layer • PrintScreen key — Sends screen to clipboard
during animation which can then be pasted to another application
• Can freely change the position, size, and color of an − Alt + PrintScreen — Sends only the active window to clipboard
object

ISYS 2088 Modelling and Simulation 119/25 ISYS 2088 Modelling and Simulation 120/25

Page 20
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Running Running (cont’d)


• Run Menu, Run and Run Interaction Toolbars • Check Model ( ) — Checks for errors, like compiling
• Go ( ) — Runs simulation ‘normally’ (depends on • Review Errors — Displays errors of the last check
Options... selected from the Tools menu)
• Run Control — Controls how the model is run
• Step ( ) — One ‘step’ at a time (to verify, debug)
• Command ( ) — Brings up an interactive command-
• Fast-Forward ( ) — Disables animation (faster run)
line window to control run at low level
• Pause ( ) — Freezes run; to resume, click Go
• Break… ( ) — Sets time and condition to interrupt
• Start Over ( ) — Goes back to the very beginning run for checking or illustration
of the simulation
• End ( ) — Gets out of the run mode (to edit mode) • Watch… ( ) — Brings up a window to watch the
changing value of a variable or expression during run

ISYS 2088 Modelling and Simulation 121/25 ISYS 2088 Modelling and Simulation 122/25

Running (cont’d) Viewing the report

• Break on Module — Stop the running of the model • Click Yes in the Arena box at the end of the run
at a particular module to facilitate debugging − Opens up a new reports window (separate from model
window) inside the Arena window
• Highlight Active Module — Highlights a particular − Project Bar shows Reports panel, with different reports (each
module while running a model to provide a visual one would be a new window)
indication of the action during the animation − Remember to close all reports windows before future runs
• Batch Run (No Animation) — Run the model • Default installation shows Category Overview
without animation to speed up the simulation report – summarizes many things about the run
− Reports have “page” to browse ( and )
• SIMAN — Displays the underlying SIMAN .mod
− Also, “table contents” tree at left for quick jumps via ,
and .exp files generated from the opened Arena
model • Times are in Base Time Units for the model

ISYS 2088 Modelling and Simulation 123/25 ISYS 2088 Modelling and Simulation 124/25

Viewing the report - examples Types of statistics reported


• Entity → Time → Total Time → Part: • Many output statistics are one of three types:
− Avg. time in system was 6.4397 min., max was 12.6185
− Tally – avg., max, min of a discrete list of numbers
• Resource → Usage → Instantaneous Utilization → Drill Press:
• Used for discrete-time output processes like waiting times in
− Utilization was 0.9171 (busy 91.71% of the time) queue, total times in system
• Process → Other → Number In → Drilling Center: − Time-persistent – time-average, max, min of a plot of
− During the run, 7 parts entered the Drilling Center something where the x-axis is continuous time
• Process → Other → Number Out → Drilling Center: • Used for continuous-time output processes like queue lengths,
− 5 entities left the Drilling Center (so were produced) WIP, server-busy functions (for utilizations)
• Entity → Time → Wait Time → Part: − Counter – accumulated sums of something, usually just nose
− Avg. wait time in all queues was 3.0340 min. (counts only entities that counts of how many times something happened
left the system, but Queue → Time → Waiting Time → Drilling
• Often used to count entities passing through a point in the model
Center.Queue counts all entities that left this queue, so can differ)
• Entity → Other → WIP → Part:
− Average Work in Process was 1.7060, max WIP was 4 125/25 ISYS 2088 Modelling and Simulation 126/25

Page 21
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Class activity

• Divide the class into groups and


study the Arena® 10.0 Help file.
ISYS 2088 Modelling and Simulation
• Discuss with your group members at Lecture 4 – Working with Arena
will so as to ensure your
understanding of the Help file
content.

• Read the following topics:


− Introduction to Arena
− Overview of the Model Building
Environment
− Simulation Concepts

ISYS 2088 Modelling and Simulation 127/25

Opening an existing model Building the simple processing model


• File/Open … or button • Open a new model window
− Navigate to desired disk and directory • Attach the Basic Process template (Check
− Click/Open or double-click Model 03-01.doe File/Template Panel/Attach… tab or click the
button if not automatically attached)
• Model window XXX .doe is the default
extension of Arena model • Drop in Create, Process, and Dispose flowchart
files
− Where a model is built modules from template
− Have Flowchart view and/or Spreadsheet view • Click the Resource button to edit animation
− Toggle between the two views using button pictures
• Click the Plot button to create two dynamic
• Template toolbar at left plots
− Tabs (Common, Attach…) • Double-click and edit modules as indicated in
− Basic Process refers to commonly used modelling constructs Chapter 3 of Simulation with Arena (4th edition)
− Attach… adds in other modelling panels (XXX.tpo)
ISYS 2088 Modelling and Simulation 129/25 ISYS 2088 Modelling and Simulation 130/25

Building the simple processing model The simple part-processing system


(cont’d) revisited
• Connect logic modules as required using the
Connect button
• Dress up model with drawing and text

• Set up running conditions: Run → Setup… • Logical structure of the model


− A first-in, first-out (FIFO) queue of parts feeds to a server
• Run model by clicking the Run button ( ) or
hitting F5 • Objectives
− To estimate expected production
− To estimate time in queue, queue length, proportion of time when
machine is busy

• Note
− To be consistent about the unit of time used
ISYS 2088 Modelling and Simulation 131/25 ISYS 2088 Modelling and Simulation 132/25

Page 22
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Viewing the model window Viewing the model window


Menu Bar
Toolbars
• Underlying world space for a model
Project
Bar
Model • Pan with scroll bars or arrow keys
Window
Flowchart • Zoom in (down) with button or + key
Flowchart View
Module • Zoom out (up) with button or - key
• See all at minimum altitude: button or * key
• Named views
Spreadsheet − Save a pan/zoom view for different parts of a model
Module
− Assign a Hot key (case-sensitive)
− Access via View/Named Views … or ? key
Model • Display grid ( ), snap to grid ( ) toggles
Template Window
Status Bar
ISYS 2088 Modelling and Simulation Spreadsheet
133/25 ISYS 2088 Modelling and Simulation 134/25
View

Modules The Create flowchart module

• Represent the components of a simulation model • A ‘birth’ node for arrival of entities
• Two basic types: • To open, double-click on module handle — The
− Flowchart modules — Have entities flowing through, box that contains the module name
connected or routed to each other
− Data modules — Have no entity flow, no connections,
pertaining to entire model
• Open an existing module: double-click on it
− Main dialog, several levels of subdialogs
• Place a new module
− (Single-) click from Template toolbar
− Crosshairs, drop (click) at any location desired

ISYS 2088 Modelling and Simulation 135/25 ISYS 2088 Modelling and Simulation 136/25

The Entity data module The Process flowchart module

• Specifies the characteristics of the entities • Represents a ‘service’ station (i.e., machine +
• Shown in spreadsheet view resource + processing time)

ISYS 2088 Modelling and Simulation 137/25 ISYS 2088 Modelling and Simulation 138/25

Page 23
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

The Resource data module The Queue data module

• Specifies the characteristics of the queue at the • Specifies the type of the resources to be used in
process module the process module
• Shown in spreadsheet view • Shown in spreadsheet view

ISYS 2088 Modelling and Simulation 139/25 ISYS 2088 Modelling and Simulation 140/25

The Dispose flowchart module Dynamic plot

• Represents entities leaving the system • Created using the Plot button

ISYS 2088 Modelling and Simulation 141/25 ISYS 2088 Modelling and Simulation 142/25

Animating resources Setting the run conditions


• Created using the Resource button • Call from the menu bar: Run → Setup…
• Specifies the run conditions of the model

ISYS 2088 Modelling and Simulation 143/25 144/25

Page 24
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Module connections Dressing things up

• Created using the Connect button or called from • Make model clearer to understand or more close
the menu bar: Object → Connect to the real system in appearance
• Used to connect the flowchart modules to let • Add drawing objects from the Draw toolbar to
entities move from one module to another represent walls, aisles, potted plants, etc.
• Assume no delay in traveling, i.e., zero travel time. • Add text to annotate things
• Use the Animate Connectors button to see − Font type, size, color, and orientation can be changed
animation of flow of entities along connectors.

ISYS 2088 Modelling and Simulation 145/25 ISYS 2088 Modelling and Simulation 146/25

Running the model Understanding what has happened

• Plain-vanilla run: Click button from the Run • A combination of two approaches
toolbar or F5 to run simulation − Event-oriented approach (bookkeeping) vs. process-oriented
approach (flowchart)
− First time running or after making changes: Check (F4)
− Model building uses a process-oriented approach
− Can move objects around when in run mode — But not edit
• ‘flowcharting’ activities - laying out the sequence of activities
− Can speed up (>) or slow down (<) animation display required to move the entity through the system, supplying the
data required to support these entity action
− Can choose to see summary results (via MS Notepad or
other text editor) when simulation completes • Focuses on what happens to entities
• A more natural and easy way of modelling for the modeller
− Click button or Alt+F5 to get out of run mode
− When running, Arena uses an event-oriented approach by
− Can pause run with button, click to resume translating the process view to an event view
• Other run control, viewing, checking options − Translation is taken care of by the software; invisible to user

ISYS 2088 Modelling and Simulation 147/25 ISYS 2088 Modelling and Simulation 148/25

Launching entities into model: Processing the entity:


The Create module The Process module
• Entity creation is the first thing the model does • Represents processing
− In reality, entity could have existed earlier but they are outside − Resource
the boundaries of modelled system • Name (defaults to Resource #, can be changed to any name)
• Total number of units in the system
• The Create module launches entities into the model • Fixed capacity of units or scheduled number during run
at appropriate intervals • Any downtime, failures
• Modeller and software fill in attribute values to • Status: busy, idle, failed, … and others
describe the entity • Animation picture changes for indicating different states
− Queue to wait for resource (if necessary)
− Can Mark arrival time in an attribute
• FIFO, LIFO, or ranked
− Can use Assign module to assign attribute values − Service process (time required to service)
• Collects statistics
ISYS 2088 Modelling and Simulation 149/25 ISYS 2088 Modelling and Simulation 150/25

Page 25
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Leaving the model: Controlling the run:


The Depart module The Run Setup
• After going through the Depart module, an entity • Controls the type of simulation to run
ceases to exist in the model (though in reality − Limit length of simulated time for a replication
could continue to exist but it is outside the model • One way to turn off a run
boundary) • There are other ways to stop
• Can have multiple stopping rules — Stop when first one is hit
• Another opportunity to collect statistics
− Number of replications
− Count (total production)
− ‘Warm up’ model before retaining statistics
− Tally interval of time and other things
• Station name is required

ISYS 2088 Modelling and Simulation 151/25 ISYS 2088 Modelling and Simulation 152/25

Class activity Exercises 3-1, 3-2, and 3-3


• Ex. 3-1: Make multiple replications (say, 5) of the Simple
• Redevelop Model 3-1 (pp. 62 – Processing model (i.e., Model 3-1). Look at the output and note
89) using Arena 10.0 installed how the performance measures vary across replications. You
on the PC. can find the statistics in the Category by Replication report and
the Category Overview report.
• Discuss with your classmates • Ex. 3-2: Make a double-time arrival modification (i.e., change
to overcome any difficulties inter-arrival time from EXPO(5) to EXPO(2.5) in the Create
during redevelopment, if any. module). Rerun the model (by making five replications) and
compare the results with the original model.
• Divide the class into groups • Ex. 3-3: Lengthen the run beyond 20 minutes to 12 hours.
and work on Exs. 3-1, 3-2, 3-3, Modify the plots to accommodate the change so that they will
and 3-6 on pp. 110 – 111 of the be complete. You will need to extend the Time Range as well as
textbook. the Maximum value for the y axis in the Number in Queue plot.
Rerun the model to see if the modification is successful.
ISYS 2088 Modelling and Simulation 153/25 ISYS 2088 Modelling and Simulation 154/25

Exercise 3-6
• Modify the Simple Processing model (i.e., Model 3-1) with all
of the following changes:
1. Add a second machine to which all parts go immediately after exiting
the first machine for a separate kind of processing (e.g., cutting and ISYS 2088 Modelling and Simulation
cleaning). Processing times at the second machine are the same as
for the first machine. Gather all the statistics as before, plus the time
Lecture 4 - Basic Operations and Inputs
in queue, queue length, and utilization at the second machine.
2. Immediately after the second machine, there’s a pass/fail inspection
that takes a constant 5 minutes to determine and has a 20% chance
of failure. Queuing rule is FIFO. All parts exit the system regardless of
whether they pass the test. Count the number that fail and the
number that pass, and gather statistics on the time in queue, queue
length, and utilization at the inspection station. (Hint: Try the Decide
flowchart module.)
3 Add plots to track the queue length and number busy at all three
stations.
4. Run the simulation for 8 hours instead of 20 minutes.
155/25

Page 26
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

An electronic assembly and test system


(Model 4.1) Part A
Part A Prep Rework
Scrapped
Part A
EXPO(5)
20%

Salvaged
• Interarrival time: EXPO(5) min.
Sealer 80%

TRIA(1,4,8)
9%
EXPO(45)
and
Shipped
− Assuming that there is no waiting for person or cart to
Arrivals transfer, i.e., parts move by themselves
Part B Prep

Part B
Part A
TRIA(1,3,4)
91%
• Go to Part A Prep area
Shipped
Batches of 4
EXPO(30)
Part B
WEIB(2.5,5.3)
− Process time (machine + debur + clean) ~ TRIA(1,4,8) min.
TRIA(3,5,10)
• Go to Sealer
• Two different sealed electronic units: Part A and Part B
− Process time (assemble + test) ~ TRIA(1,3,4) min.
• Arriving parts (A and B) are metal cases machined to accept
− 91% pass the test and go to Shipped; else go to Rework
electronic parts
• Separate preparation areas for Part A and Part B
• Rework: (re-process + testing) ~ EXPO(45) min.
• Both parts go to Sealer for assembly and testing — Then to
− 80% pass, go to Salvaged and Shipped; others go to
Scrapped
Shipped if OK, or else to Rework
• Rework — Salvaged and Shipped or Scrapped

ISYS 2088 Modelling and Simulation 157/25 ISYS 2088 Modelling and Simulation 158/25

Part B Run conditions, output, and animation


• Interarrival time: batches of 4, EXPO(30) min. • Start empty and idle; run for 32 hours
• Upon arrival, batch breaks into 4 individual parts • Output:
• Go to Part B Prep area − Utilisation of all resources
− Process time (machine + debur +clean) ~ TRIA(3,5,10) min. − Number in each queue
− Time in each queue
• Go to Sealer
− Cycle time (flowtime) for shipped parts, salvaged and
− Process time (assemble + test) ~ WEIB(2.5, 5.3) min. shipped parts, and scrapped parts
different from Part A, though processed at the same station
• Animation:
− 91% pass the test and go to Shipped; else go to Rework
− Queue length, resources status (busy or idle)
• Rework: (re-process + test) = EXPO(45) min. − Entity movement between stations (2 min. transfers)
− 80% pass the test and go to Salvaged and Shipped; others
go to Scrapped
ISYS 2088 Modelling and Simulation 159/25 ISYS 2088 Modelling and Simulation 160/25

Developing a modeling approach Building the model


• Define submodels, modules, data structures, and control • New model window
logic
• Attach Basic Process panel (if needed)
• Decide on an appropriate level of detail
• Place modules
• Often there are many ways to model (diff. logic)
− Create (× 2)
• This model: − Assign (× 2) Alternate strategy –
− Entities are the individual parts (two types) − Process (× 4) place one module at a
− Separate Create modules for each part type − Decide (× 2)
time, fill it out completely
− Separate Process modules for each Prep area − Record (× 3)
− Process modules for Sealer and Rework, each followed by a − Dispose (× 3)
Decide module (2-way by Chance
− Depart modules for Shipped, Salvaged and Shipped, Scrapped • Right click — repeat last action (place module)
− Attribute Sealer Time assigned after Create modules in Assign • Auto-Connect, or manually connect via
modules (parts have different times at the Sealer)
− Record modules just before Depart modules for time in system
161/25 ISYS 2088 Modelling and Simulation 162/25

Page 27
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Part A Create module Part B Create module


• Name: Part A Arrive Once these entries are made,
• Name: Part B Arrive
• Entity Type: Part A they are placed on the list for • Entity Type: Part B
names of that type (Module
• Time Between Arrivals Name, Entity Type, etc.) and • Time Between Arrivals
will appear on future pull-down
− Type: Random (Expo) lists for that type of name.
− Type: Random (Expo)
• Pull-down list with options • Pull-down list with options
− Value: 5 − Value: 30
− Units: Minutes − Units: Minutes
• Pull-down list with options • Pull-down list with options
• Use default values for other parameters • Entities per Arrival: 4

ISYS 2088 Modelling and Simulation 163/25 ISYS 2088 Modelling and Simulation 164/25

Part A attributes Assign module Part B attributes Assign module


• Name: Assign Part A Sealer and Arrive • Name: Assign Part B Sealer and Arrive
Time Time
• Add button: • Add button:
− Type: Attribute − Type: Attribute
− Attribute Name: Sealer Time − Attribute Name: Sealer Time
− New Value: TRIA(1, 3, 4) − New Value: WEIB(2.5, 5.3)
• Add button: • Add button:
− Type: Attribute − Type: Attribute
− Attribute Name: Arrive Time − Attribute Name: Arrive Time
− New Value: TNOW (to compute time in system on exit) − New Value: TNOW (to compute time in system on exit)
TNOW is the internal Arena variable name for the simulation clock; see Names for things in Arena
Help > Arena Help > Contents > – Default names usually suggested
Variables, Functions, and Distributions > Variables > Date and Time Variables – Names placed on appropriate pull-down lists for future reference
165/25 – All names in a model must
ISYS be
2088unique (even
Modelling and across different kinds of objects)
Simulation 166/25

Part A Process module Part B Process module


• Name: Prep A Process • Name: Prep B Process
• Action: Seize Delay Release • Action: Seize Delay Release
• Resources subdialog (Add button): If several Resources
• Resources subdialog (Add button):
− Type: Resource (a pull-down option) were named (Add − Type: Resource (a pull-down option)
− Resource Name: Prep A button), entity would − Resource Name: Prep B
have to Seize them
− Quantity: 1 (default) all before the Delay − Quantity: 1 (default)
• Delay Type: Triangular could start. • Delay Type: Triangular
• Units: Minutes • Units: Minutes
• Minimum: 1 • Minimum: 3
• Value (Most Likely): 4 • Value (Most Likely): 5
• Maximum: 8 • Maximum: 10
ISYS 2088 Modelling and Simulation 167/25 ISYS 2088 Modelling and Simulation 168/25

Page 28
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Sealer Process module Sealer inspection-result Decide module

• Name: Sealer Process • Decide module provides branch points


• Action: Seize Delay Release − By Condition (entity Attributes, global Variables)
− By Chance (multi-sided, possibly-biased hypercoin flip)
• Resources subdialog (Add button): • Name: Failed Sealer Inspection
− Type: Resource (a pull-down option)
• Type: 2-way by Chance (default)
− Resource Name: Sealer
− Quantity: 1 (default)
• Percent True: 9
• Delay Type: Expression Recall – Sealer Time attribute • Different exit points for True, False results –
was defined upstream for both connect appropriately downstream
• Units: Minutes Parts A and B … now its value is
being used … allows for different
− Note it’s percent true, not probability of true … so “9” means probability of 0.09.
• Expression: Sealer Time distributions for A and B.
− We arbitrarily decided “true” meant part failed inspection.

ISYS 2088 Modelling and Simulation 169/25 ISYS 2088 Modelling and Simulation 170/25

Rework Process module Rework inspection-result Decide module

• Name: Rework Process • Name: Failed Rework Inspection


• Action: Seize Delay Release • Type: 2-way by Chance (default)
• Resources subdialog (Add button): • Percent True: 20
We arbitrarily decided “true”
− Type: Resource (a pull-down option) meant part failed inspection
− Resource Name: Rework
− Quantity: 1 (default)
• Delay Type: Expression Had to use the general Expression
choice for Delay Type since what we
• Units: Minutes want (EXPO) is not directly on the
• Expression: EXPO(45) Delay Type pull-down list.

ISYS 2088 Modelling and Simulation 171/25 ISYS 2088 Modelling and Simulation 172/25

Record modules Shipped parts Record module


• Arena collects and reports many output statistics • Name: Record Shipped Parts
by default, but sometimes not all you want • Type: Time Interval
• Want time in system (avg, max) of parts sorted by − Records time elapsed up to now (TNOW) from when an entity
their exit point (Shipped, Salvaged, Scrapped) attribute was marked with a time “stamp” upstream ... Attribute
Name is below ...
− It’s this sorting that Arena doesn’t do by default ... it would
− There are several other options for Type … explore via Record
automatically sort by Entity Type if we had Entities checked
module’s Help button!
in Run > Setup > Project Parameters (which we don’t)
• Attribute Name: Arrive Time
• Record module can be placed in flowchart to
collect and report various kinds of statistics from − Was defined upstream as the clock value in the Assign modules
instantly after each entity was Created
within model run as entities pass through it
• Tally Name: Record Shipped Parts
• For Tally-type output performance measures − Determines the label in the reports
Other two Record modules –
just like this except for Name
and Tally Name.
ISYS 2088 Modelling and Simulation 173/25 ISYS 2088 Modelling and Simulation 174/25

Page 29
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Dispose modules Run > Setup for run control

• Three separate exit points for three separate part • Without this, model would run forever – no
disposition (Shipped, Salvaged, Scrapped) defaults for termination rule
− That’s part of modeling, and generally affects results!
• Could have directed all three exit types to a single
• Project Parameters tab:
Dispose module
− Fill in Project Title, Analyst Name
− Separate ones gets animation counts of three dispositions − Defaults for Statistics Collection, but we cleared the check
− Separate Dispose modules allows for differentially checking box for Entities
the boxes to Record Entity Statistics • Not needed for what we want (we installed our own Record
modules), and would slow execution
• Produces flow statistics separated by entity type (if Entities
Statistics Collection is checked in Run > Setup > Project • Replication Parameters tab:
Parameters), not by final disposition of part … so we did need − Replication length: 32, accept Hours default for Time Units
our Record modules and Arrive Time attribute
− Base Time Units: Minutes for inputs without Time Units
option, internal arithmetic, and units on output reports
ISYS 2088 Modelling and Simulation 175/25 ISYS 2088 Modelling and Simulation 176/25

Different part A, B entity pictures Running the model


• Check (if desired)
• Entity data module (just single-click on it in
− If errors exist, use Find button to help find errors
Project Bar, edit via spreadsheet only) • Go (will automatically pre-Check if needed)
• Row for each Entity Type (Part A, Part B) − Some graphics don’t show during run … will return when you End
your run … control via View > Layers
• Pull down Initial Picture pull-down menu, select − Status Bar shows run progress – replication number, simulation
different pictures for each Entity Type time, simulation status
− Edit > Entity Pictures to see, change the list of pictures that’s • Pause or Esc key; to resume
presented here − Step
− Double-click on things to see status (debug)
• Fast Forward
− Alternative: Use Run/Setup…/Mode/Batch Run (No Animation) to
turn animation off before running
• Animation speed
ISYS 2088 Modelling and Simulation 177/25 − Slider bar at top, or increase (> key), decrease (< key) 178/25

The enhanced electronic assembly and


Viewing the results test system (Model 4.2)
• When done, asked if you want to see numerical • Original model shown to production manager
results (text) − Pointed out that this is only the first shift of a two-shift day — on
second shift there are two operators at Rework (the bottleneck
− Can navigate through report with browsing arrows station) … 16-hour days
− Or use Notepad to view the model_name.out − Pointed out that the Sealer fails sometimes
• Tally, Discrete Change (a.k.a. time-persistent), • Uptimes ~ expo (2) hours
Counters areas (if present in model) • Repair times ~ expo (4) min.
− Wants to buy racks to hold rework queue
− Columns for averages, min, max, number of observations or
• A rack holds 10 parts
final value
• How many racks should be bought?
• Half Width column: − Run for 10 days (16-hour days)
− For 95% confidence interval on steady-state (long-run) • Need: Resource Schedules, Resource States,
expected average Resource Failures
− (Insuff) for not having enough data, (Corr) for correlated data
179/25 180/25

Page 30
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Run conditions Schedules

• Redefine a “day” to be 16 hours – Run > Setup > • Vary Capacity (no. of units) of a resource over time
Replication Parameters • In Resource Data module (spreadsheet view)
• Change Replication Length to 10 (of these) days − For Rework Resource, change Type from Fixed Capacity to
Based on Schedule
− Two new columns – Schedule Name and Schedule Rule
− Type in a Schedule Name (Rework Schedule)
− Select a Schedule Rule – details of capacity decrease if the
Resource is allocated to an entity
• Wait – Capacity decrease waits until entity releases Resource,
and “break” will be full but maybe start/end late
• Ignore – Capacity goes down immediately for stat collection, but
work goes on until finished … “break” could be shorter or gone
ISYS 2088 Modelling and Simulation 181/25 • Preempt – Processing is interrupted, resumed at end of “break”
182/25

Schedules (cont’d) Schedules (cont’d)

• Define the actual Schedule the Resource will • Alternatively, right-click in the row, select Edit via
follow – Schedule data module Dialog
− Row already there since we defined Rework Schedule − Enter schedule Name
− Format Type is Duration for entries based on elapsed time − Enter pairs for Capacity, Duration … as many pairs as
past simulation start time needed
− Type is Capacity, for Resource schedule (more later on • If all durations are specified, schedule repeats forever
Arrival Type) • If any duration is empty, it defaults to infinity
− Click in Durations column, get Graphical Schedule Editor − Can involve Variables, Expressions
• X-axis is time, Y-axis is Resource Capacity • Another alternative – right-click in the row, select
• Click and drag to define the graph Edit via Spreadsheet
• Options button to control axis scaling, time slots in editor,
whether schedule loops or stays at a final level forever − Enter capacity Value, Duration pairs
• Can use Graphical Schedule Editor only if time durations are
integers, with no Variables or Expressions involved 183/25 ISYS 2088 Modelling and Simulation 184/25

Resource failures Resource failures (cont’d)

• Usually for unplanned, random downtimes • Attach this Failure to the correct Resource
• Can start definition in Resource or Failure module − Resource module, Failures column, Sealer row – click
− Get pop-up Failures window, pick Failure Name Sealer
(Advanced Process panel) Failure from pull-down list
• Attach Advanced Process panel if needed, single- − Choose Failure Rule from Wait, Ignore, Preempt (as in
click on Failure, get spreadsheet view Schedules)

• To create new Failure, double-click – add new row • Can have multiple Failures (separate names)
acting on a resource
• Name the Failure • Can re-use defined Failures for multiple
• Type – Time-based, Count-based Resources (operate independently if they involve
• Specify Up Time, Down Time, with Units for both random variables)

ISYS 2088 Modelling and Simulation 185/25 ISYS 2088 Modelling and Simulation 186/25

Page 31
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Frequencies Frequencies (cont’d)


• Record time-persistent occurrence frequency of • Add another Frequency (in Statistic module) to
variable, expression, or resource state give a finer description of the Sealer states
− Use here to record % of time rework queue is of length 0, (0, − Produces statistics on proportion of time Sealer is in each of
10], (10, 20], … for information on number of racks needed its three possible states – Busy, Idle, and Failed
• Statistic data module (Advanced Process panel) • Frequencies are not part of default Category
− Five Types of statistics, of which Frequencies is one Overview report
− Specify Name (Rework Queue Stats), − Open Frequencies report from Project Bar (get separate
Frequency Type (Value) window)
− Specify Expression to track and categorize
• Right-click in field to get to Expression Builder
− Report Label (Rework Queue Stats)
− Pop-up secondary spreadsheet for Categories (browse file)

ISYS 2088 Modelling and Simulation 187/25 ISYS 2088 Modelling and Simulation 188/25

Results of Model 4-2 Utilizations


• Differ from those of Model 4-1 since this is a • Two utilizations reported for each Resource
longer run, modeling assumptions are different − Instantaneous Utilization is the time-average of the ratio of
− All of which causes underlying random-number stream to be the number of units that are busy to the number of units that
used differently (Chapter 12) are scheduled
• By definition, counts periods when zero units are scheduled as
• Prep A/B didn’t change (other than run length and zero-utilization periods
random variation) … need statistical analysis of − Scheduled Utilization is the average number busy divided by
simulation output (Chapters 6, 7, 12) the average number available
• Sealer is more congested (it now fails) • No division-by-zero problem, assuming there were ever any
units of the Resource scheduled at all (if not, it shouldn’t be in
• Rework is less congested (50% higher staffing) the model)
• Frequencies report suggests one rack suffices • Identical for fixed-capacity Resource
about 95% of the time, two racks all the time • Can differ for Resources on a variable Schedule
− Standard vs. Restricted Percents – see text − If Resource capacity varies among several different positive
ISYS 2088 Modelling and Simulation 189/25
values, it’s better to use Scheduled Utilization 190/25

Enhancing the animation


(Model 4.3) Changing animation queues

• Get generic default animation for some things • Can be lengthened (click, hold Shift key and drag)
(queues, connector-animation movement) • Can rotate to re-orient for enhanced realism
− Usually sufficient for verification, validation
• Can change the ‘form’ of the queue from Line (the
• Often want to customize, enhance it a bit default) to Point — fixed places for entities
− More realism, impact − Double-click on the queue
• Pull animation away from logic in model window − Select Type to be Point
− Useful for big models, complex animation − Click Points… button
− Named Views for model logic, animation, or close-ups − Successively click Add for points, then OK
• Default animation objects are connected to model − Drag them around on screen
logic and move with the module − Check Rotate box to show entities turning
− Identifiers, physical location (Shift-drag to decouple)
191/25 ISYS 2088 Modelling and Simulation 192/25

Page 32
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Changing the entity pictures Adding resource pictures


• Earlier – used Entity data module to assign • Animate a Resource – Resource button in animate
different Initial Pictures to different Entity Types toolbar – get Resource Picture Placement window
• Can customize list, alter pictures in it • Left column – default pictures for different Resource states
− Edit > Entity Pictures − Attach logically to a Resource by Identifier pull-down list
− Left column – names, pictures currently on the list − Double-click to edit artwork by hand, or paste in previously copied
graphics images
− Right column –picture libraries (.plb filename extension)
− Seize area – where seizing entity will “reside”
− Add a hand-drawn picture – Add button on left, name it in
− Multiple seize areas for multi-capacity Resources
Value field at top, double-click on blank depressed button,
then artwork (or paste in a copied graphics image) • Right column – picture libraries (.plb files) – can copy over to
• New name won’t appear in Entity data module until you type it selected (depressed) state pictures
there • Accept window, cross hairs, click to place
− Edit an existing picture – double-click, artwork
− Resize, reposition later
− Copy a picture over from picture library
193/25 ISYS 2088 Modelling and Simulation 194/25

The electronic assembly and test


Adding variables and plots system with parts transfer (Model 4.4)
• Variable animation – just show a value of • Generalize Model 4-3
something as a number, watch it change • All part transfers now take 2 minutes (not instant)
− Variable object from Animate toolbar − Model, animate this
− Double-click, specify Expression to be shown (Expression − Materially changes model logic, results
Builder), and cosmetics
− Two-minute transfer times for:
− Resize, reposition later
• Arriving parts to prep areas
• Dynamic animated plots – Chapter 3 • Departing parts to appropriate exit
• Other animation objects from Animate toolbar • All internal part transfers

− Clock (TNOW), variety of formats − Transfers take two minutes regardless of distance
• Fix this (unrealistic) assumption in Chapter 8
− Level (thermometer) animation
− Others discussed later
ISYS 2088 Modelling and Simulation 195/25 ISYS 2088 Modelling and Simulation 196/25

New Arena constructs Adding the route logic – from arrival


• Station – location where some process occurs • Stations and Station Transfers affect both the model
− Arrivals, manufacturing cells, departures logic and the animation
− Each Station given a unique name • Start with Model 4-3 … change to Model 4-4
− Can serve as an entry point for a section of model logic
• For incoming parts (A and B) delete connection from
− Station marker represents a logical station in the
flowchart/animation
Assign modules to “Prep” Process modules
− Replace with Station/Route module pairs
• Station Transfer – entities move between Stations without
• Station module (Advanced Transfer panel) – define entity’s location
direct connection – Module Name vs. Station Name
− Several different types – we’ll use Routes here, which allow for positive • Route module (Advanced Transfer panel) – send entity out
transfer time, but no other delays like “room” on the transitway or – Route Time, Destination Station
transporters
− No direct connections exiting from the Route modules – Route
− Route paths represent Routes in the flowchart/animation module’s Destination Station Name defines that
ISYS 2088 Modelling and Simulation 197/25 198/25

Page 33
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Adding the remaining route logic Why not just add delays?
• Add Station modules for entry to each Prep area • Simpler way to get the two-minute transfer times:
− Station names are Prep A Station, Prep B Station,
and are the destination stations for Routes after arrivals − Insert a Process module with Action = Delay for 2 minutes
on each relevant connection
• Process modules for Prep A, Prep B unchanged
− Or, use Delay module from Advanced Process panel
• After prep, entities connected to Route module to
send to next station (sealer) • This would work from modeling, numerical-output
− Don’t need a separate Station module for outgoing side viewpoints
• Similar changes for rest of model • But would not allow animation of part transfers,
− Station modules for incoming parts into sealer, rework, each so we’ll proceed with the Stations and Routes
of three Record modules (entity exit points)
− Route modules for outgoing parts out of sealer inspection,
rework inspection (two for each Decide module – pass/fail)
• Could run model now, get correct results … but
no animation of transfers … 199/25 ISYS 2088 Modelling and Simulation 200/25

Altering the animation – stations Altering the animation – routes

• Add animation for Stations and Routes • Route button from Animate Transfer toolbar
• Station button , Animate Transfer toolbar − Options for appearance of entities as they travel the route
− Get cross hairs; click in origin, destination Station Markers
− Attach Identifier to it from pull-down list of station names
• Intermediate clicks for corners along the route
− Get cross hairs, place (click) marker in animation
− Can drag around endpoints, corners later
− Can place several station markers for the same logical
− Alternatively, use Route animation to create both Station
station (e.g., to represent incoming, outgoing sides)
markers and Route animation
− Can drag station markers around later • Click for beginning Station marker
• Intermediate clicks for route corners
• Double-click for ending Station marker
• Then go back and double-click on the two Station markers to
define their logical Identifiers

ISYS 2088 Modelling and Simulation 201/25 ISYS 2088 Modelling and Simulation 202/25

Altering the animation – entity pictures Finding and fixing model errors

• Part B arrivals are in batches of four parts/batch • If error prevents model from running, Arena will
− But constant travel time to Prep B implies they travel “on top try to detect and lead you to it in Check or Run
of each other” so it looks like just one part B − Undefined (or inconsistently spelled) Variables, Attributes,
− Try – change Route time from 2 to EXPO(2), see separation Resources
along the route
− Unconnected modules
• Create a dishonest illusion to animate the batch − Duplicate names
− Assign module just after Part B Arrive − Examples – see text
− Add assignment of Entity Picture to Picture.Batch B
• Highlight Active Module – selects active module
− Edit > Entity Pictures to draw the new picture
during run animation
• Copy Picture.Part B and rename it Picture.Batch B
• Double-click on picture, use Picture Editor to get four circles • View > Layers while running – change what
− When batch arrives to Prep B, change to single circle shows during run animation
• Add Assign module after Prep B Arrival Station 203/25 ISYS 2088 Modelling and Simulation 204/25

Page 34
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Input analysis: specifying model


Finding and fixing model errors (cont’d) parameters and distributions
• Module Break – stop when entity reaches module • Structural modeling: what we’ve done so far
• Debug Bar − Logical aspects – entities, resources, paths, etc.
− View > Debug Bar • Quantitative modeling
− Breakpoints, Calendar, Active Entity, Watch − Numerical, distributional specifications
− Run Controller − Like structural modeling, need to observe system’s
− Examples – see text operation, take data if possible

ISYS 2088 Modelling and Simulation 205/25 ISYS 2088 Modelling and Simulation 206/25

Deterministic vs. random inputs Collecting data

• Deterministic: nonrandom, fixed values • Generally hard, expensive, frustrating, boring


− Number of units of a resource − System might not exist
− Entity transfer time (?) − Data available on the wrong things – might have to change
− Interarrival, processing times (?) model according to what’s available
− Incomplete, “dirty” data
• Random (a.k.a. stochastic): model as a
distribution, “draw” or “generate” values from to − Too much data (!)
drive simulation • Sensitivity of outputs to uncertainty in inputs
− Transfer, Interarrival, Processing times • Match model detail to quality of data
− What distribution? What distributional parameters? • Cost – should be budgeted in project
− Causes simulation output to be random, too
• Capture variability in data – model validity
• Don’t just assume randomness away – validity
207/25 • Garbage In, Garbage Out (GIGO) 208/25

Using data: Fitting distributions to data


alternatives and issues with the Arena Input Analyzer
• Use data “directly” in simulation • Assume:
− Read actual observed values to drive the model inputs − Have sample data: Independent and Identically Distributed
(interarrivals, service times, part types, …) (IID) list of observed values from the actual physical system
• Arena ReadWrite module ... see Model 10-2
− Want to select or fit a probability distribution for use in
− All values will be “legal” and realistic generating inputs for the simulation model
− But can never go outside your observed data
− May not have enough data for long or many runs • Arena Input Analyzer
− Computationally slow (reading disk files) − Separate application, also via Tools menu in Arena
• Or, fit probability distribution to data − Fits distributions, gives valid Arena expression for generation
− “Draw” or “generate” synthetic observations from this to paste directly into simulation model
distribution to drive the model inputs
− We’ve done it this way so far
− Can go beyond observed data (good and bad)
− May not get a good “fit” to data – validity? 209/25 ISYS 2088 Modelling and Simulation 210/25

Page 35
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Fitting distributions to data


with the Arena Input Analyzer (cont’d) Data files for the Input Analyzer

• Fitting = deciding on distribution form • Create the data file


(exponential, gamma, empirical, etc.) and − Editor, word processor, spreadsheet, ...
estimating its parameters − Plain ASCII text – save as text or export)
− Several different methods (Maximum likelihood, moment − Values separated by white space – blanks, tabs, linefeeds
matching, least squares, …) − Otherwise free format
− Assess goodness of fit via hypothesis tests • Open data file from within Input Analyzer
• H0: fitted distribution adequately represents the data
− File > New or
• Get p value for test (small = poor fit)
− File > Data File > Use Existing or
• Fitted “theoretical” vs. empirical distribution − Get histogram, basic summary of data
• Continuous vs. discrete data, distribution − To see data file: Window > Input Data

• “Best” fit from among several distributions • Generate “fake” data file to play around
211/25 − File > Data File > Generate New 212/25

Fit Menu Fit Menu (cont’d)

• Fits distributions, does goodness-of-fit tests • Fit all of Arena’s (theoretical) distributions at
• Fit a specific distribution form once
− Plots density over histogram for visual “test” − Fit > Fit All or
− Gives exact expression to Copy and Paste (Ctrl+C, Ctrl+V) − Returns the minimum square-error distribution
over into simulation model • Square error = sum of squared discrepancies between
histogram frequencies and fitted-distribution frequencies
− May include “offset” depending on distribution
• Can depend on histogram intervals chosen: different intervals
− Gives results of goodness-of-fit tests can lead to different “best” distribution
• Chi square, Kolmogorov-Smirnov tests − Could still be a poor fit, though (check p value)
• Most important part: p-value, always between 0 and 1:
− To see all distributions, ranked: Window > Fit All Summary
– Probability of getting a data set that’s more inconsistent with the
fitted distribution than the data set you actually have, if the the
or
fitted distribution is truly “the truth”
– “Small” p (< 0.05 or so): poor fit (try again or give up)
213/25 ISYS 2088 Modelling and Simulation 214/25

Fit Menu (cont’d) Issues in fitting input distributions

• “Fit” Empirical distribution (continuous or • Not an exact science – no “right” answer


discrete): Fit > Empirical • Consider theoretical vs. empirical
− Can interpret results as a Discrete or Continuous distribution • Consider range of distribution
• Discrete: get pairs (Cumulative Probability, Value) − Infinite both ways (e.g., normal)
• Continuous: Arena will linearly interpolate within the data range − Positive (e.g., exponential, gamma)
according to these pairs (so you can never generate values
outside the range, which might be good or bad) − Bounded (e.g., beta, uniform)
− Empirical distribution can be used when “theoretical” • Consider ease of parameter manipulation to
distributions fit poorly, or intentionally affect means, variances
• Simulation model sensitivity analysis
• Outliers, multimodal data
− Maybe split data set (details in text)
ISYS 2088 Modelling and Simulation 215/25 216/25

Page 36
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

No data? Cautions on using normal distributions

• Happens more often than you’d like • Probably most familiar distribution – normal “bell
curve” used widely in statistical inference
• No good solution; some (bad) options:
• But it has infinite tails in both directions … in
− Interview “experts”
particular, has an infinite left tail so can always
• Min, Max: Uniform
(theoretically) generate negative values
• Avg., % error or absolute error: Uniform
− Many simulation input quantities (e.g., time durations) must be
• Min, Mode, Max: Triangular
positive to make sense – Arena truncates negatives to 0
– Mode can be different from Mean – allows asymmetry
− Interarrivals – independent, stationary
• If mean μ is big relative to standard deviation σ,
then P(negative) value is small … one in a million
• Exponential – still need some value for mean
− But in simulation, one in a million can happen
− Number of “random” events in an interval: Poisson
− See text, Model 4-5
− Sum of independent “pieces”: normal (heed left tail ...)
• Moral – probably avoid normal as input distribution
− Product of independent “pieces”: lognormal
217/25 ISYS 2088 Modelling and Simulation 218/25

Nonstationary arrival processes Nonstationary Arrival Processes (cont’d.)

• Events (often arrivals), rate varies over time • Two issues:


− Lunchtime at fast-food restaurants − How to specify/estimate the rate function
− Rush-hour traffic in cities − How to generate from it properly during the simulation
− Telephone call centers • Several ways to estimate rate function – we’ll just do
− Seasonal demands for a manufactured product the piecewise-constant method
• It can be critical to model nonstationarity for − Divide time frame of simulation into subintervals of time over
model validity which you think rate is fairly flat
− Ignoring peaks, valleys can mask important behavior − Compute observed rate within each subinterval
− Can miss rush hours, etc. − In Arena, must convert to expected number of arrivals per hour
on subintervals that need not be of one-hour length
• Good model: Nonstationary Poisson process • Want expected 45 arrivals in a half hour; specify rate = 90 per hour

ISYS 2088 Modelling and Simulation 219/25


• Example: Model 5-2 in Chapter 5 220/25

Multivariate and Correlated Input Data Class activities

• Usually assume all generated random • Redevelop Model 4-1 (pp. 115
observations in a simulation are independent – 128) using Arena 10.0
(though from possibly different distributions) installed on the PC.
• Sometimes not true:
• Discuss with your classmates
− A “difficult” part requires long processing in both the Prep
and Sealer operations to overcome any difficulties
− This is positive correlation
during redevelopment, if any.
• Ignoring such relations can invalidate model • Divide the class into groups
• See text for ideas, references and work on Exs. 4-1 – 4-3 on
p. 188 of the textbook.

ISYS 2088 Modelling and Simulation 221/25 ISYS 2088 Modelling and Simulation 222/25

Page 37
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Exercise 4-1 Exercise 4-2


• Travelers arrive at the main entrance door of an airline • Develop a model of a simple serial two-process system.
Items arrive at the system with a mean time between arrivals
terminal according to an exponential interarrival-time
of 10 minutes, with the first arrival at time 0. They are
distribution with mean 1.6 minutes. The travel time from the immediately sent to Process 1, which has a single resource
entrance to the check-in is distributed uniformly between 2 with a mean service time of 9 minutes. Upon completion,
and 3 minutes. At the check-in counter, travelers wait in a they are sent to Process 2, which is identical to (but
single line until one of five agents is available to serve independent of) Process 1. Items depart the system upon
them. The check-in time (in minutes) follows a Weibull completion of Process 2. Performance measures of interest
distribution with parameters β = 7.76 and α = 3.91. Upon are the average numbers in queue at each process and the
completion of their check-in, they are free to travel to their total time in system of items. Using a replication length of
gates. Create a simulation model, with animation (including 10,000 minutes, make the following four runs and compare
the results (Note: model structure remains unchanged):
the travel time from entrance to check-in), of this system.
Run the simulation for 16 hours to determine the average − Run 1: exponential interarrival times and exponential service times
time in system, number of passengers completing check-in, − Run 2: constant interarrival times and exponential service times
and the average of the check-in queue. − Run 3: exponential interarrival times and constant service times
− Run 4: constant interarrival times and constant service times
ISYS 2088 Modelling and Simulation 223/25 224/25

Exercise 4-3 Exercise 4.3


• Modify the Exercise 4-1 check-in problem by • This is how the schedule is worked out:
adding agent breaks. The 16 hours are divided into
two 8-hour shifts. Agent breaks are staggered, 1st hour 2nd hour 3rd hour 4th hour 5th hour 6th hour 7th hour 8th hour
starting at 90 minutes into each shift. Each agent 1
is given one 15-minute break. Agent lunch breaks
2
(30 minutes) are also staggered, starting 3½ hours
3
into each shift. The agents are rude and, if they’re
busy when break time comes around, they just 4

leave anyway and make the passenger wait until 5


break time is over before finishing up that
=90x5 =75x5-(15x5) =45x5 =150x5-(30x5) =120x5
passenger. Compare the result of this model to the =75x4 =150x4
result without agent breaks. 15-minute break 30-minute lunch break Schedule Rule: Preempt

ISYS 2088 Modelling and Simulation 225/25 ISYS 2088 Modelling and Simulation 226/25

Model 7-1:
A small manufacturing system

ISYS 2088 Modelling and Simulation


Lecture 7 - Intermediate Modelling
• Part arrivals, four cells, part departures
• Cells 1, 2, and 4: single machine each
• Cell 3: Two machines — new and old. The new one is faster
and can process parts in 80% of the time required by the old
machine.
− Needs a way to model non-identical resource units
• Circular layout of cells
• Parts enter at left, exit at right, travel only in clockwise
direction, all transfer times = 2 min.
ISYS 2088 Modelling and Simulation 228/25

Page 38
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

A small manufacturing system (cont’d) New Arena concepts


• Three separate part types • Non-identical machines at Cell 3
− Interarrivals (all types merged) ~ expo(13) minutes • Different entity types follow different process
− 26% type 1, 48% type 2, 26% type 3
plans
• Different part types follow different routes, have − Previous models – all entities went through same sequence
different (triangular) processing times: of stations, maybe with Decides for branching
At Cell 3,
parameters − Now, need process plan with automatic routing by entity type
are for slow – different Sequence assigned to each entity (like an
machine attribute), and entity follows its own sequence
− Won’t use direct Connect or Routes … instead, tell entities
departing from modules to follow their own Sequence
• Observe utilizations, time/number in queues, − Arena internally keeps track of where entity is, where it will
cycle times (times in system) by part type go next
• Run for 32 hours 229/25 ISYS 2088 Modelling and Simulation 230/25

The modeling approach Sequence data module


• Usually there are many ways to build a model • Advanced Transfer panel
• Important to think about data structures • Double-click for new row for each process plan
− Name for each Sequence
− What data are available?
− Open Steps column for subdialog
− How will they be stored in the model?
• Define ordered sequence of Stations to be visited in the
• For this model … Sequence … must have Station Names already defined
− Use Sequence for part transfer (described below) • Double-click to add a new Station to the bottom of the
Sequence list; right-click to insert/delete a row
− As part of Sequence definition, can define Attributes
• Name for each step
• Do for processing times at all cells but Cell 1
• Possible Assignments of Attribute, Variable, Pictures, etc. at
− Use an Expression for processing times at Cell 1 each station in the Sequence … this is done before transferring
• Just to show that there are other ways to do the same thing the entity to this step in the sequence
− Use Variables for new-machine speedup at Cell 3, part • In this model, Attribute assignment used to attach Process
transfer times Time Attribute to entity for the next Cell (except for Cell 1)
− Use Sets to group similar objections into collections, e.g., 231/25
parts 232/25

Sequence data module (cont’d) Expression data module


• Assign Sequence Name to entities that follow it • Advanced Process panel
• In Route modules, select Sequence as • Use for processing times at Cell 1
Destination Type (rather than Station)
− Departing entity looks in its own sequence to know where to − Could have done in Sequences, as for other Cells … done
go next this way mostly to illustrate its use
• Arena tracks Sequence-following entities via • Three different part types at Cell 1, so use a
automatic attributes vector-valued Expression with three rows
− Sequence name, NS (or Entity.Sequence)
− Name for the expression, Cell 1 Times
− Station (where entity is or is going to), M (or Entity.Station)
− JobStep along the sequence, IS (or Entity.JobStep) − Rows, 3
• Normally, entity is assigned a Sequence, travels − Expression Values subdialog
its route, then exits • Cell 1 processing times for the three part types
− Can interrupt this sequence, jump forward or backward • Order matters, since index is part type … will reference as
Cell 1 Times(Part Index) in model
• Remember to define the “exit” station 233/25 234/25

Page 39
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Variable data module Set data module


• Basic Process panel • Basic Process panel
• Factor variable • Define three sets
− Speed factor at Cell 3 – need a two-row vector − Resource set, Cell 3 Machines
• Assume new (faster) machine is #1, old (slower) machine is #2
• For new and old machine (in that order) at Cell 3
• Set to 0.8 for index 1; set to 1.0 for index 2
• Resource Names – could have already defined them in
• Transfer Time variable Resource data module, or can define them here
− Holds transfer-time constant of 2 minutes between stations − Entity Picture set, Part Pictures
− Just a scalar, not a vector or matrix • To attach to entities once their part type is determined
− Used for model generality – if all transfer times changed, this • Picture Names – could have already defined them elsewhere
makes it easy to implement this change (Edit > Entity Pictures), or can define them here
• These are the initial values of variables … any entity − Entity Type set, Entity Types
can change them • To attach to entities once their part type is determined
− But they’re constant in this model 235/25 • Entity Types – define them here 236/25

Advanced Set data module Run > Setup and Edit > Entity Pictures
• On Advanced Process panel • Run > Setup Dialog
• Needed since Set data module does not have − Replication Parameters Tab
“Sequence” category for Type • Replication Length = 32 Hours
• 24 Hours/Day
− Need to form a set of Sequences to attach the right one to
arriving entities once their part type is determined • Base Time Units = Minutes

− Define Name of set to be Part Sequences • Edit > Entity Pictures


− Set Type is “Other” which basically means anything − Create three custom pictures – Picture.Part 1,
− Members subdialog – Add rows, type in names in “Other” Picture.Part 2, Picture.Part 3
column (have to remember or look up the Sequence names) − Copy blue, red, and green ball pictures
− Rename them
− Picture Editor to put white numbers inside via Text object

ISYS 2088 Modelling and Simulation 237/25 ISYS 2088 Modelling and Simulation 238/25

Model logic Part arrivals


• Part arrival • Create module for arrival of one part
− Create → Assign → Station → Route (i.e., station transfer) − One-at-a-time, Time Between Arrivals is exponential with
mean 13 minutes, i.e., expo (13 )
− Don’t know the part type yet …

• Part processing • Assign module for part attributes


− Part Index = draw from DISC probability distribution
− Station → Process → Route (i.e., station transfer)
• Pairs cumulative probability, value
• Here, we need to assign Part Index first, as it’s used below
− Entity.Sequence = Part Sequences(Part Index)
• Part departure • Part Index attribute already assigned … order matters
• Index into Part Sequences (Advanced) Set
− Station → Dispose
− Entity.Type = Entity Types(Part Index)
− Entity.Picture = Part Picture(Part Index)
239/25 ISYS 2088 Modelling and Simulation 240/25

Page 40
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Release Arriving Entity into System Logic for Cell 1


• Use previously defined Sequences, assigned to • Station module to define the station location
entity via (Advanced) Set of Sequences − Station Name = Cell 1, on pull-down list for stations since
it was previously defined in Sequences
• Send arriving entity through a Station module to • Cell 1 Process module
define its current station location − Action = Seize Delay Release
− Station Name = Order Release − Resources subdialog
− Other five station names already defined via Sequences • Type = Resource (not Set … yet)
• Resource Name = Cell 1 Machine, Quantity to seize = 1
• Route module to start it on its way − Delay Type = Expression
− Route Time = Transfer Time (a Variable previously • Expression = Cell 1 Times(Part Index) Minutes, using
defined) Minutes the previously-defined Expression Cell 1 Times

− Destination Type = By Sequence • Route module from Cell 1


• Arena will direct this entity according to its own sequence − Destination Type = By Sequence
• It just arrived so Arena initializes its JobStep attribute − Station already defined (on incoming side)
241/25 242/25

Logic for Cells 2 and 4 Logic for Cell 3


• Incoming Station module – similar to Cell 1 • Station, Route modules – similar to Cells 1, 2, 4
− Except for names of Module and Station • Process module
• Process module − Action, Delay Type – similar to Cells 1, 2, 4
− Action, Resources, Delay Type – similar to Cell 1 − Resources subdialog
• Type = Set, Set Name = Cell 3 Machines
− Expression for Delay time = Process Time
• Selection Rule for set = Cyclical
• Attribute defined in Sequence module for each job type at this – 1st → 2nd → 1st → 2nd → …
point in its sequence for Cells 2 and 4 • Save Attribute = Machine Index (will be 1 or 2)
• Note that Part Type 2 visits Cell 2 twice in its sequence, with − Expression for Delay time =
different delay-time distributions … this data structure is Process Time * Factor(Machine Index)
general enough to handle this to multiply by 0.8 if entity gets the new machine (#1), using
• Outgoing Route module – similar to Cell 1 the preciously-defined vector variable Factor
− Except for name of Module − See book for alternative expression that avoids the need for
the vector variable Factor
243/25 244/25

Digression: data structures Logic for exiting the system


• Why an Expression for processing times at Cell 1 • Station module to define this location
rather than entity Attribute assigned in − Station Name = Exit System
Sequences as for the other cells? • Dispose module
− Frank answer: Just to show the use of Expression − Record Entity Statistics box is checked
− Could easily have treated Cell 1 like the others − Will generate one of the outputs we want, cycle time (time in
• Conversely, could have used Expression for system) separated out by part type, since they map onto the
processing times at Cells 3 and 4 entity types for this model
− But there would be a problem with Cell 2 − So don’t need separate Record modules here to collect cycle
times
• Part 2 visits it twice with different processing-time distributions,
so would have to indicate which visit somehow • Model would run at this point, give correct output
− Moreover, this is a very small model results … but develop animation to show queues,
• Moral: Think carefully about data structure! resources, and movement …
245/25 246/25

Page 41
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Animation Verification
• Pull animation away from logic, data modules • System → Model → “Code”
• Move, resize, reorient queues for realism • Validation: Is Model = System?
• Animate Routes (all movement possibilities) • Verification: Is “Code” = Model? (debugging)
− Thick “bundles” of routes — Shift key, Snap to Grid • The Truth: Can probably never completely verify,
− Heed clockwise direction especially for large models
− Draw lines to define route “lanes” • General approaches for model verification:
• Import, modify AutoCAD .dxf file for backdrop and − Allow only one entity to enter the system at a time and watch
resource pictures (see text) how the model performs using the Step ( ) button.
• Fine-tune resource pictures − Replace some or all model data with constants and see if the
deterministic model outcomes are as expected.
− Layers for seize point
− Test the model under extreme conditions, i.e., stressed-out runs.
• In animation, note that entities travel at very − Make long runs to see if there are problems or the performance
different rates, pass each other. Why? (Hint: 2 min.)
247/25 of the model is as expected. 248/25

Statistical analysis of output from


Verification (cont’d) steady-state simulations
• Some techniques to attempt verification • Recall: Difference between terminating, steady-state
− Eliminate error messages simulations
− Single entity release, Step through logic − Which is appropriate depends on goal of study, and not so much
• Set Max Batches = 1 in Arrive on the model structure
• Replace part-type distribution with a constant • Most models could be used for terminating or steady-state analysis
− “Stress” model under extreme conditions • Now, assume steady-state is desired
− Performance estimation − Be sure this is so, since running and analysis is a lot harder than
− Look at generated SIMAN .mod and .exp files for terminating simulations
• Run > SIMAN > View • Naturally, simulation run lengths can be long
− Opportunity for different internal computation order
− Can change numerical results
− Underscores need for statistical analysis of output
ISYS 2088 Modelling and Simulation 249/25 250/25

Warm up and run length Warm up and run length (cont’d)


• Most models start empty and idle • Remedies for initialization bias
− Empty: No entities are present at time 0 − Better starting state, more typical of steady state
− Idle: All resources are idle at time 0 • Throw some entities around the model
− In a terminating simulation this is OK if realistic • Can be inconvenient to do this in the model
− In a steady-state simulation, though, this can bias the output • How do you know how many to throw and where?
for a while after startup – This is what you’re trying to estimate in the first place!

• Bias can go either way − Make the run so long that bias is overwhelmed
• Usually downward (results are biased low) in queueing-type • Might work if initial bias is weak or dissipates quickly
models that eventually get congested − Let model warm up, still starting empty and idle
• Depending on model, parameters, and run length, the bias can • Run > Setup > Replication Parameters: Warm-up Period
be very severe – Time units!
• “Clears” all statistics at that point for summary report, any Outputs-
type saved data from Statistic module of results across replications
ISYS 2088 Modelling and Simulation 251/25 252/25

Page 42
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Warm up and run length (cont’d) Warm up and run length (cont’d)
• Warm-up and run length times? • No explosions
− Most practical idea: preliminary runs, plots • All seem to be
− Simply “eyeball” them settling into
steady state
− Be careful about variability — make multiple replications,
superimpose plots • Run length
seems
− Also, be careful to note “explosions”
adequate to
• Possibility – different Warm-up Periods for reach steady
different output processes state
− To be conservative, take the max • Difficult to
determine
− Must specify a single Warm-up Period for the whole model
warm-up period
from plots
ISYS 2088 Modelling and Simulation 253/25 254/25

Warm up and run length (cont’d) Warm up and run length (cont’d)
• Create a single overall output performance • In Output Analyzer
measure for Model 7-1 … modify it into Model 7-2 − New data group, Add the file Total WIP History.dat
− Measure is time-average total number of parts in system − Graph > Plot or
− Statistic module − Add Total WIP History.dat, Replications = All, enter
• Time-Persistent type, Name and Report Label Total WIP Title, axis labels
Warmup Period

• Expression (via Expression Builder … details in book)


EntitiesWIP(Part 1) + EntitiesWIP(Part 2) + EntitiesWIP(Part 3)
• Output File Total WIP History.dat to save within-run data
– Animated plots disappear, can’t overlay plots from multiple
replications … will use Output Analyzer to plot the saved data
− Speed up the run
• Check Run > Run Control > Batch Run (No Animation)
• Uncheck boxes in Run > Setup > Project Parameters
− No apparent explosion
• Lengthen Replications to 5 days, do 10 Replications − Warm-up about 2000 min.; round up to 2 days (2880 min.)
255/25 256/25

Truncated replications Truncated replications (cont’d)


• If you can identify appropriate warm-up and run- • Get cross-replications 95% confidence-interval Half
length times, just make replications as for Widths in Reports
terminating simulations − For average Total WIP, got 16.39 ± 6.51
− Without the Warm-up, this was 15.35 ± 4.42
− Only difference: Specify Warm-up Period in
− To sharpen the comparison of the effect of the Warm-up, did 100
Run > Setup > Replication Parameters (rather than 10) replications with and without it:
− Proceed with confidence intervals, comparisons, all • With Warm-up:15.45 ± 1.21
statistical analysis as in terminating case • Without Warm-up: 14.42 ± 0.88
• Model 7-3: modify Model 7-2 − Half Widths with Warm-up are larger since each replication is
based on the last 3 days, not all 5 days
− Warm-Up period = 2 Days
• Want smaller confidence intervals? Have a choice:
− Stick with (total) replication length of 5 Days
− More replications, same length (i.e., increase n)
− Stick with 10 replications − Same number of replications, each one longer (i.e., reduce s)
− Delete Output File in Statistic module • This might be the safer choice to guard against initialization bias
257/25 258/25

Page 43
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Truncated replications (cont’d) Batching in a single run


- Replication #1

• The first • If model warms up very slowly, truncated


approach is to replications can be costly
run the model − Have to “pay” warm-up on each replication
- Replication #2
many times,
each with • Alternative: Just one REALLY long run
warm up, and − Only have to “pay” warm-up once
get the − Problem: Have only one “replication” and you need more than
- Replication #3 statistics after that to form a variance estimate (the basic quantity needed for
the warm-up statistical analysis)
periods.
• Big no-no: Use the individual points within the run as “data” for
• Then, find the variance estimate
- Replication #4 means and • Usually correlated (not indep.), variance estimate biased
half-width:
s
• Use batching only when you are doing steady-state
X ± t n −11
, −α / 2259/25 simulation 260/25
n

Batching in a single run (cont’d) Batching in a single run (cont’d)


• Break each output record from the run into a few • Modify Model 7-3 into Model 7-4
large batches − One replication of 50 days (about the same effort as 10
− Tally (discrete-time) outputs: Observation-based replications of 5 days each)
− Time-Persistent (continuous-time): Time-based − A single 2-day Warm-up Period (no statistics are collected)
• Take averages over batches as “basic” statistics − Statistic module, save WIP data once again for plot
for estimation: Batch means How to choose batch size?
− Tally outputs: Simple arithmetic averages
Equivalently, how to
− Time-Persistent: Continuous-time averages choose the number of
batches for a fixed run
• Treat batch means as IID length?
− Key: batch size must be big enough for low correlation
Want batches big enough
between successive batches (details in text)
so that batch means
− Still might want to truncate (once, time-based) appear uncorrelated.
261/25 ISYS 2088 Modelling and Simulation 262/25

Batching in a single run (cont’d) Batching in a single run (cont’d)


• Arena attempts to form 95% batch-means confidence • Results from Model 7-4:
intervals on steady-state output measures from − Category Overview report, average total WIP: 13.64 ± 1.38
within the single replication
− Half Width considerably smaller than for truncated replications
− “Half Width” column in reports from one replication (10 replications, 5 days each, 2-day Warm-ups)
• In Category Overview report if you just have one replication
• Here we spend only a total of 2 days warming up, and with truncated
• In Category by Replication report if you have multiple replications replications we spent 10 × 2 = 20 days warming up
− Uses internal rules for batch sizes (details in text)
• Can check batch-means half widths during run
− Won’t report anything if your run is not long enough
• “(Insufficient)” if you don’t have the minimum amount of data Arena − Arena variables THALF(Tally ID), DHALF(Dstat ID)
requires even to form a c.i. • Can decide on your own batch sizes, form batch
• “(Correlated)” if you don’t have enough data to form nearly-
uncorrelated batch means, required to be valid means and c.i.’s “by hand” with Output Analyzer
− If you’re doing a terminating simulation, you should be doing − Why? Use in statistical comparison procedures, more flexible
multiple replications, in which case Arena reports cross- − How? Save output in a .flt file and use Output Analyzer to find C.I.
replication half widths, not batch-means half widths 263/25 264/25

Page 44
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Batching in a single run (cont’d) What to do?

• Picture for WIP (time-persistent): • Several approaches, methods for steady-state


statistical analysis … many more exist
• Opinion:
− Avoid steady-state simulation … look at goal of project
− For observation-based Tallies, just count points − If you really do want steady-state
• To batch and analyze: • First try Warm-up, truncated replications
• If model warms up slowly, making truncated replications
− Statistics module, Time-Persistent, Tally areas to save
inefficient, consider Arena’s batch-means methods in a single
within-run records (files could be very big) long run with a single Warm-up Period at its beginning … can’t
− Output Analyzer, Analyze/Batch/Truncate or use statistical methods in PAN or OptQuest, though
• Warning will be issued if batches are too small for IID • Other methods, goals in steady-state statistical
− Get means from .flt file; calculate classical C.I. as before analysis – references in text
265/25 ISYS 2088 Modelling and Simulation 266/25

Confidence intervals for terminating


systems Confidence interval dialogs

• Use Output Analyzer to analyse data from files Add files to Data Group
saved from Outputs area (cross-replication) of
Statistics module Select files
for confidence
• Define, read in, save Data Group(s) intervals
• In Output Analyzer
− Analyze/Conf. Interval on Mean/Classical… menu (or )
− Add desired files; select Lumped for Replications Can change confidence level
(95% is default)

Select “Lumped”
Replications treatment
to use all replications

ISYS 2088 Modelling and Simulation 267/25 ISYS 2088 Modelling and Simulation 268/25

Automatic text-only 95% confidence


Confidence interval results intervals
• At end of summary report, get 95% confidence intervals as
above, in text-only format, if
− You ask for more than one replication, and
− You have a Statistics module with Outputs entries
• Done only for output measures in Statistics module’s
Outputs area
OUTPUTS
Identifier Average Half-width Minimum Maximum # Replications
_______________________________________________________________________________
avg WIP 11.327 1.7801 6.3666 18.704 20
Part 1 cycle avg 148.38 23.809 93.763 296.79 20
Part 2 cycle avg 189.47 25.602 124.38 296.29 20
Cell 4 avg Q length 1.5652 .64270 .48813 6.4610 20

• Interpretation of confidence intervals


Cell 2 avg Q length 1.7943 .66541 .45236 6.3355 20
Cell 1 avg Q length 1.7960 .52429 .45934 4.5093 20
− What’s being estimated Part 3 cycle avg 107.80 15.704 65.692 193.10 20
Cell 3 avg Q length 1.2976 .40001 .45141 3.3876 20
− Coverage, precision, robustness to non-normality
ISYS 2088 Modelling and Simulation 269/25 ISYS 2088 Modelling and Simulation 270/25

Page 45
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Half width and number of replications Half width and number of replications (cont’d)
s2
• Prefer smaller confidence intervals — Precision • Set half-width = h, solve for n = t n2−11
, −α / 2
h2
• Notation: n = no. replications • Not really solved for n (t, s depend on n)
X = sample mean
s = sample standard deviation • Approximation:
, −α / 2 = critical value from t tables
t n −11 − Replace t by z, corresponding normal critical value
• Confidence interval: X ± t n −11, −α / 2 s − Pretend that current s will hold for larger samples
n s2
s − Get n ≅ z12−α / 2
h2 s = sample standard deviation from ‘initial’
• Half-width = t n−11
, −α / 2 Want this to be “small,” say
number n0 of replications
n < h where h is prespecified • Easier but different approximation:
• Cannot control t or s h02 n grows quadratically
n ≅ n0 h0 = half width from ‘initial’
• Must increase n to reduce interval — How much? h2 number n0 of replications as h decreases.

ISYS 2088 Modelling and Simulation 271/25 ISYS 2088 Modelling and Simulation 272/25

Comparing alternatives Comparing alternatives (cont’d)


• Usually, need to compare alternative system • Analyze/Compare Means menu (no button)
configurations, layouts, scenarios, sensitivity − Add comparable data files for A and B
analysis … − Lumped Replications
• In this example: Transfer time (2 min.) is just a
guess — does it matter transfer time is 1 or 3 min.
instead?
− Call these alternatives A and B in Arena
• Single measure of performance: average WIP
• Make two sets of 20 replications, for A and B
− Must rename output files to distinguish them

ISYS 2088 Modelling and Simulation 273/25 ISYS 2088 Modelling and Simulation 274/25

Comparing alternatives (cont’d) Class activity


• Results: • Redevelop Model 7-1 (pp. 293
– 305) using Arena 10.0
installed on the PC.

• Discuss with your classmates


to overcome any difficulties
during redevelopment, if any.

• Divide the class into groups


• c.i. on difference misses 0, so it can be concluded
and work on Exs. 7-3 – 7-5 on
that there is a (statistically) significant difference
pp. 321 – 322 of the textbook.

ISYS 2088 Modelling and Simulation 275/25 ISYS 2088 Modelling and Simulation 276/25

Page 46
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Exercise 7-3 Exercise 7-4


• A part arrives every 10 minutes to a three-workstation system
• Using the model from Exercise 7-2, change the (i.e., three single machines: A, B, and C). There are four part
processing time for the second pass on Machine 1 types, each with equal probability of arriving (the first part
to TRIA (6.7, 9.1, 13.6) using Sequences to control arrives at time 0). The process plans for the four part types are
as follows (all processing times are in minutes and are
the flow of parts through the system and the triangularly distributed):
assignment of process times at each machine. − Part 1: A (5.5, 9.5, 13.5) → C(8.5, 14.1, 19.7)
Run the simulation for 20,000 minutes. To the − Part 2: A (8.9, 13.5, 18.1) → B(9, 15, 21) → C(4.3, 8.5, 12.7)
extent possible, indicate the batch-based − Part 3: A (8.4, 12, 15.6) → B(5.3, 9.5, 13.7)
confidence intervals on expected steady-state − Part 4: B (9.2, 12.6, 16.0) → C(8.6, 11.4, 14.2)
performance measures from this run. • Assume that the transfer time between all stations (incl. arrival
to first station and last station to exit) is three minutes. Use the
Sequence feature to direct the parts through the system and to
assign the processing times at each station. Use the Sets
feature to collect cycle times for each of the part types
ISYS 2088 Modelling and Simulation 277/25 separately. Run the simulation for 10,000 minutes. 278/25

Exercise 7-5

• Modify your solution for Exercise 7-4 to use the


Expressions feature for determining the
processing times (rather than assigning them in ISYS 2088 Modelling and Simulation
the Sequence data module). Run for 10,000 Lecture 8 - Entity Transfer
minutes and compare the results to those from
Exercise 7-4. Are the results different? If so, why?

ISYS 2088 Modelling and Simulation 279/25

Types of entity transfers so far New types of entity transfers


• Connect • Resource-constrained transfers
− Zero-delay − Limit total number of entities in transit at a time
− Connection graphic vs. module Labels (no graphic) − Entities still have their own feet
• Route − Telecommunications (number of packets),
− Non-zero-delay — constant, e.g., 2 min.; expression, e.g., logistics (number of vehicles)
expo (2) min. • Material-handling devices
− Stations, animated Routes − Transporters – fork lifts, trucks, carts, wheelchairs
− Fixed routes vs. entity-dependent Sequences • Usually place limits on numbers, capabilities of transporters
• Connect and Route both assume: • Like a Resource, except moveable
− No limit on number in transit at a time − Conveyors
− Entities have their own feet • Belts, hook lines, escalators, freeways
• Usually limit space on conveyor, speed
ISYS 2088 Modelling and Simulation 281/25
• Non-accumulating vs. accumulating 282/25

Page 47
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Model 8-1: Small manufacturing system Two ways to model resource-


with resource-constrained transfers constrained transfers
• Original system (Model 7-1) assumptions • Both use a new Transfer Resource representing
− All transfer times = 2 minutes … keep (for now) space on the transitways
− Parts have their own feet … keep (for now) − Capacity set to 2 in Resource data module
− No limit on number of parts in transit at a time … dump
• Maybe the most obvious way (but won’t do) …
• Now – no more than 2 parts can be in motion at a given time
• If other parts are ready to go, they must wait until there’s room − Before each Route module insert a Seize module to Seize
to go one unit of Transfer (queue, priority details … see text)
• Model via existing constructs — think creatively − After each Station module (except Order Release) insert
− Model “space” on the “road” as a Resource a Release module to free up one unit of Transfer
− Limit the number of Units of this Resource − Shared vs. separate queues (details in text)
− Entity must Seize unit of “space” resource before beginning − Can’t animate entity movement
trip, Release it at end of trip

ISYS 2088 Modelling and Simulation 283/25 ISYS 2088 Modelling and Simulation 284/25

Two ways to model resource-


constrained transfers (cont’d) Transporter Concepts
• Different way (will do, to illustrate new modules, set • Carts, fork lifts, trucks, wheelchairs, people, …
up for transporters and conveyors) • When entity is ready to go somewhere, it needs to
− Replace Route modules with Leave modules (Advanced Transfer be “picked up” and moved
panel)
• Transfer Out: Seize unit of Transfer resource before leaving station
• Use Transporters — “moveable” resources
– Resource, Resource Set, particular member of a Resource Set • Activities: Request, Transport, Free
– Can specify priorities − Transporter Selection Rule: If > 1 transporter is available
• Also contains the Route-module logic, options when Requesting
• Get individual queues, with animation, for parts waiting to go − When freed and > 1 entity is waiting: Priorities, closest one
− Replace Station modules with Enter modules (Advanced Transfer • Two types of Transporters
panel)
− Free-Path (will do)
• Defines the Station
• Travel time depends only on velocity, distance
• Option of an unload Delay time (0 for this model)
• Ignore “traffic jams” and their resulting delays
• Transfer In: Release Transfer resource
− Guided (won’t do)
• Effect – slight increase in cycle times in system285/25 • AGVs, intersections, etc. 286/25

The small manufacturing system with The small manufacturing system with
transporters transporters (cont’d)
• Have two carts to transport parts • Create Transporter in Transporter data module
− A cart can carry one part at a time (Advanced transfer panel)
− Carts move at 50 feet/minute − Name = Cart, Number of Units = 2, Velocity = 50
• Will need to specify accurate distances between Stations − Default the Distance Set (later), Units = Per Minute, Initial
− It takes 0.25 minute to load part on a cart, 0.25 minute to Positions
unload it from a cart • Mind the units – consistency here, in Distance Set (later)
• Modify Model 8-1 to Model 8-2 • Animation picture for Cart Transporter
− Transporter button , Animate Transfer toolbar
− Identifier = Cart, pictures for Idle, Busy, Inactive states
− Draw or copy from .plb picture libraries
− Ride point (details in book)
− Drop it anywhere in flowchart view (hidden during run)
ISYS 2088 Modelling and Simulation 287/25 288/25

Page 48
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

The small manufacturing system with The small manufacturing system with
transporters (cont’d) transporters (cont’d)
• Request a Cart – modify existing Leave modules • Free the Cart – modify existing Enter modules
− Delay = 0.25 Minute for load time − Delay = 0.25 Minute for unload time
− Transfer Out = Request Transporter − Transfer In = Free Transporter
− Transporter Name = Cart − Transporter Name = Cart
− Selection Rule = Smallest Distance
− Unit Number = Cart # attribute of part entity
• Applies when > 1 transporter is available
• Others: Cyclic, Random, Preferred Order, Largest Distance (???) • Instead of Enter: Station-Delay-Free
− Save Attribute = Cart # (remember which cart … for later) − More complex, more flexible – book has details, examples
− Connect Type = Transport
• Move Time disappears … determined by Velocity, Distances (later)
− Station Type = By Sequence
• Instead of Leave: Request-Delay-Transport
− More complex, more flexible – details, examples in text
289/25 ISYS 2088 Modelling and Simulation 290/25

Distances for transporters Animating transporter movement


• Define contents of Distance Set Cart.Distance • Add distances to animation
• Distances (in feet) moved by parts: • Delete all the old Route Path animation objects
Units!!
− But leave the Station animations
• Add animated transporter distances with
Distance button , Animate Transfer toolbar
− Blank cells: part movements that don’t occur − Dialog, placement similar to Route Paths
− Identifier = Cart.Distance
• Enter these data in Distance data module
(Advanced Transfer panel) − Select “From” Station, “To” Station
− Name = Cart.Distance Units!! − Options for Rotate, Flip
− Stations button, add 11 rows with Beginning Station, Ending − Single-click to create “From” Station marker, then clicks for
Station, Distance for above data Why are there 25 rows? corners, then double-click to create “To” Station marker
− Direction is implied; could be asymmetric − Snap to Grid to help place animated transporter distances
ISYS 2088 Modelling and Simulation 291/25 292/25

Parking areas for transporters More distances — empty transporters


• Animate transporters when they’re free • Above Distances incomplete — only for part
• Parking button , Animate Transfer toolbar movements along their sequences
− Like a Queue animation – Point vs. Line, Shift, Rotate • Transporters must also move when empty
− Cursor becomes cross hairs, click near lower left of Station (deadheading)
marker to start, click for first Point or head of Line − In general, n(n - 1) distances need definition for network with
− More clicks for more Points (double-click to end), or second n nodes
click to end Line − Some not possible — Order Release to Exit System
− Want enough points/space for all transporters (2 here) • 14 more distances to define in Distances data
− Repeat for all Stations where Transporters could be freed module (not grayed):

ISYS 2088 Modelling and Simulation 293/25 ISYS 2088 Modelling and Simulation 294/25

Page 49
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Model 8-3: Refining the Animation for Model 8-3: Refining the Animation for
Transporters Transporters (cont’d)
• Part Entities disappear from animation when • The trick is to replace all the Leave modules with
waiting to be picked up by a Cart Transporter Queue – Request – Delay – Transport module
after Transporter has been allocated combination available from the Blocks panel.
− Model logic OK … get right answers … animation is flawed • Only needed for better animation; increase model
− Actually, animation is OK when part’s waiting before complexity and is not really necessary.
Transporter is allocated
• Solution – Storage for entity to reside in, be Use the queue button ( ) and the storage
animated, while it waits for something (here, a button ( ) to modify the animation.
Cart Transporter)
− Can get statistics on numbers in Storages
• But Storages not available with modules from
Advanced Transfer panel
− Use lower-level SIMAN modules from Blocks panel … see • The other alternative is to use a Store – Request –
book for specific details 295/25 Delay – Unstore – Transport module combination. 296/25

Conveyors Conveyor concepts


• Replace Transporters with a conveyor • Entity to be conveyed must wait for space
• Loop conveyor to follow main path, clockwise • Conveyor consists of cells
• Six entrance/exit points − Equal size, constantly moving – think of a narrow escalator
− Load, Unload takes 0.25 minute
− Each part is 4 feet per side, but want 6 feet of conveyor • Entities might require multiple contiguous cells
space for clearance on corners • Must define cell size; tradeoff involved:
• Speed = 20 feet/minute Units!!
− Small cells: accurate model but slow execution
• Distances: − Large cells: just the opposite!
• Entities Access space, Convey, and Exit
• Conveyor = series of linear Segments
− Each segment starts and ends at a Station
− Link to form loops, diverge points, converge points
ISYS 2088 Modelling and Simulation 297/25 298/25

Model 8-4: Small manufacturing system


Types of conveyors with nonaccumulating conveyors
• Both travel in a single, irreversible direction • Modify Model 8-1 (resource-constrained transfer)
• Nonaccumulating: belt, bucket line, escalator • Define new Variables Load Time and Unload
Time, each with initial value 0.25
− Spacing between entities on it doesn’t change
− Entire conveyor stops for entity Access/Exit if Load/Unload • Delete all the Route Paths
time is > 0 • Define Conveyor via Conveyor data module,
• Accumulating: rollers, freeway Advanced Transfer panel
− Conveyor never stops moving − Conveyer = Loop Conveyor
− Segment Name = Loop Conveyor.Segment
− If entity on it stops to Exit, other entities behind it are blocked
and bunch up (entities ahead of it keep moving) − Type = Non-Accumulating
− Velocity = 20 (feet), Units = Per Minute Units!!
− When blockage ends, blocked entities go on but maybe not
all at once (spacing requirements) − Cell Size = 3 (feet) Units!!
− Max Cells Occupied = 2 (cells per entity)
ISYS 2088 Modelling and Simulation 299/25 300/25

Page 50
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Leave, Enter modules for conveyor Conveyor segments


• Change each Leave module • Define one-way lengths (in feet) of segments
− Delay = Load Time, Units = Minutes • Segment data module, Advanced Transfer panel
− Transfer Out = Access Conveyor − Name = Loop Conveyor.Segment
− Conveyor Name = Loop Conveyor − Beginning Station = Order Release
− # of Cells = 2 − Next Stations button
• Name Next Stations in correct sequence
− Connect Type = Convey
• Give distance in correct units (feet, here) to this next station
• Change each Enter module • Segment animation
− Delay = Unload Time, Units = Minutes
− Put Station markers in front of each Resource picture
− Transfer In = Exit Conveyor − Segment button , Animate Transfer toolbar
− Conveyor Name = Loop Conveyor − Dialog, crosshairs, clicking just like Distances for Transporters
• Except here, have to place only 6 Segment animations
ISYS 2088 Modelling and Simulation 301/25 302/25

Model 8-5: Change conveyors to


Conveyor statistics accumulating
• Run > Setup > Project Parameters to check • Conveyor module
Conveyor Statistics − Change Conveyor Type to Accumulating
• Get percent of time blocked (stopped) − Accumulation Length = 4 (in feet), amount of space the
accumulated parts need on the conveyor
• Utilization statistic is average percent of space
occupied on conveyor (not percent of time that a • Running, see very little accumulation in
part was on the conveyor) animation
• To see conveyor stop (it’s nonaccumulating) − To see more, increase Load Time and Unload Time
more clearly, change Load Time and Unload
Time to much greater values than 0.25
− Could do this during run with VBA (Chapter 10), or Run
Controller – see text for details – but makes output statistics
nearly impossible to interpret
ISYS 2088 Modelling and Simulation 303/25 ISYS 2088 Modelling and Simulation 304/25

Class activity Exercise 8-5

• Redevelop Model 8-2 (pp. 333 • Modify Model 4-3 to include the use of a single
– 341) using Arena 10.0 truck to transfer parts from the two prep areas to
installed on the PC. the sealer. Assume that the distance between any
pair of the three stations is 100 feet and that the
• Discuss with your classmates truck travels at a rate of 75 feet per minute.
to overcome any difficulties Animate your solution.
during redevelopment, if any.

• Divide the class into groups


and work on Exs. 8-5 and 8-6
on p. 357 of the textbook.

ISYS 2088 Modelling and Simulation 305/25 306/25

Page 51
ISYS2088 Modelling & Simulation 20 January 2009
Lecture Notes

Exercise 8-6

• Modify Model 4-3 to include the use of two


conveyors to transfer parts from the two prep
areas to the sealer. Both conveyors are 100 feet
long and are made up of 20 cells of 5 feet each.
The conveyor velocity is 30 feet per minute.
Animate your solution.

ISYS 2088 Modelling and Simulation 307/25

Page 52

Das könnte Ihnen auch gefallen