ioe 474 exam review2
TRANSCRIPT
E X A M I
IOE 474 Review
Lecture 1
Components of a System Entity - Customers Attribute – Buying Habits (groceries) Activity - Strolling through aisle State of a system - # customers in each
aisle Event – (started/finished aisle) Endogenous/exogenenous (activity,
event) – Utilization of aisles by organization of merchandise
Dynamic Model Represents a system as it changes over
time (performance of a checkout counter depends on customer arrival rate)
No random variables – inputs result in know outputs
Static Model Represents a system at a particular point
in time, time independent (closing price of stock, outcome of dice)
Random variables – represent probabilities and uncertainties of system
Discrete Model’s states change only at discrete set of
points in time – number of cars in parking lot
Continuous Model’s states change continuously in time –
Water level in reservoir, weight of person
12 Steps in a Simulation Study Formulation (What is the problem?) Define Project Goal and Plan (Is simulation
appropriate?) Model Conceptualization Or Data Collection Model Translation Verified? (Is code ok?) Validated? (Represents system well?) Experimental Design (What runs to make to
answer question efficiently?) Production Runs & Analysis (Estimate the
performance measures) More Runs? Documentation & Reporting (Scope of this class) Implementation
Lecture 2
Simulation Software Work? System State – a collection of variables
that contain all the information necessary to describe the system
FEL – Future Event List, contains all event notices scheduled to occur in the future
Basic Concepts for Simulation Clock – variable representing
simulated time List – logically ordered collection of
associated entities (queue) Event List – List of event notices
(current events, future events, blocked list)
Activity – specified duration of time, IAT and ST
Delay – unspecified duration of time (wait)
Variables – values for calculations
Set An ordered list of associated entities or
events (queue, chain) Clock
A global variable representing time in simulation
Steps in Discrete Event Simulation Determine what event will occur next Set simulation clock equal to the time
of next event Update statistical variables Perform actions (and computations)
associated with event Schedule events caused by this event
/event list Future Event List
FEL is ordered by time chronologically
Lecture 3
Random Number Generation For value to follow a certain
distribution Use value obtained by Rand() function
as the Cumulative Prob and use an inverse function to obtain the corresponding percentile
Framework Determine the characteristics of each
of the outputs Determine the activities, events and
system states Determine model responses or
performance measures Construct a simulation table
Step, Xn, For each step i, generate a value for
each activities, compute system states and outputs
When simulation ends, use the outputs to compute measures of performance
Lecture 4
Modules in Build Menu Locations – physical locations for machines,
queues, conveyors, resources Entities – people, products, which move through
or are processed by system Processes – that which happens to an entity at a
location Arrivals – the way entities enter a system Resources – required to perform operations, but
without physical location Path Networks – a map for resource motion Attributes – variables for entity or location Variables/arrays/tables/subroutines/macro/file
– just like in other programming languages Streams – control over mechanism for getting
random numbers Entities
Items that are processed by the system, such as products, pallets, or even paperwork
Entities move between locations according to processing logic
Dummy entities can be used to make simulation function correctly
Arrivals Arrival defines the entry of entities into the
system Frequency – IAT
Locations Capacity – refers to the maximum number of
entities at a location Units – refers to the number of similar locations
in a grouping Stats – define what level of detail to collect
(None, basic, time series) Rules – Select Incoming (which entry gets
admittance when selecting all entries that wish to enter), Queuing for output (determines who can compete to go into next location), Selecting a unit (only for more than one unit)
Downtimes – clock downtime, entry downtime, usage downtime, setup downtime
Processes Define the routing of entities through the system
and what operations take place Processes, Operations, Routings
Routings Entities get routed to a location according to a
rule, user condition Move
No routing blocks in operation logic, then all routing will be executed in sequence upon completion of operation logic
Lecture 5
Global Variables Can be accessed from
anywhere in the model Created using variables edit
table Local Variables Created within a logic Type of a local variable is
defined by using “INT” or “REAL” statements
Private to each entity logic processing. Each entity going through this logic creates its own local variable
Statements Wait <time>: simulates the
time it takes to process an entity
Wait Until <Boolean Expression>: Delays the further processing until the Boolean expression is true
Move for <time>: simulates the move time
Combine <number>: accumulates and combines number of entities into a single entry
INC <variable> / DEC <variable>
Lecture 6
Four Steps in Developing an Input Model Collect data from the real system Identify a probability
Develop a frequency distribution or histogram of the data
Choose a family of distributions Choose parameters Evaluate distribution
Discrete Bounded [a,b] distributions Discrete uniform – models complete uncertainty
(equal outcome) Binomial – Number of successes in n trials
Discrete Unbounded [0,infinity] Poisson – number of independent events that
occur in a fixed amount of time or space Negative Binomial – Number of trials required to
achieve k successes Continuous on (-inf,inf)
Normal – distribution of a process that can be thought of as the sum of a number of component processes
Continuous on [0,inf) Exponential – time between independent events,
memory less
Q-Q Plot construction Step 1: Order the data
X(j) – smallest to largest J – n
Step 2: q=(j-0.5)/n q(j)
Step 3: Compute gamma(y) based on the inverse of F(x).=F-1(q(j))=q(j)=gamma(j)
Step 4: Plot gamma(j) vs X(j) Yi’s are known as order statistics If F is from an appropriate distribution, should
create a straight line Continuous on [0,inf)
Gamma – an extremely flexible distribution used to model nonnegative random variables
Erlang – Models processes that can viewed as the sum of exponentially distributed processes
Continuous on [0,inf) Weibull – models the time to failure Lognormal – process that can be thought of as
the multiplication of a number of component processes
Continuous on [a,b] Beta – extremely flexible distribution used to
model bounded random variables Continuous uniform – complete uncertainty Triangular – minimum, most-likely, and
maximum values are known
Lecture 7
MLE – used to estimate the parameters we need for the distribution we have chosen. (choosing the parameters)
Testing the Distribution Evaluate distribution and associated parameters If fit is poor – repick distribution family
Chi-Squared Goodness of fit test X1, X2, … Xn are n i.i.d. samples from RV X H0: X has pdf f(x) Definte pi=p(ai-1<=x<=ai)
Probability that an observation falls within the ith interval
Oi: numbers of observations that fall in the ithinterval Oi~Bin(n,pi) – Binomal-Normal-Chi-Square
Ei=E[Oi] – expected numbers of observations that fall in the ith interval
Guideline – choose n and pi Calculate chi-squared statistic :∑(Oi-Ei)^2/Ei Compare to X^2(k-1-s),alpha
S: number of parameters estimated Alpha: significance level
If x^20>X^20(k-1-s,alpha) Reject H0 Picking ai’s
Equal probability – continuous Equal interval – ai-ai+1=ai+a-ai (discrete)
Lambda = 1/Xbar
K-S Goodness of Fit Test Formalize the idea behind the q-q plot Small sample sizes Designed to test: H0:X1,X2,…Xn CDF of U(0,1), F(x)=x, 0<=x<=1 Sn(x) : the accumulated counts of Xis until x,
normalized by the total sample size, N Sn(x) = Counts of samples X<=x/n
Steps of KS test for Uniform CDF 1 – Rank the Ris from smallest to largest 2- Compute
D+=max{i/N-Ri}, for I from 1 to N D-=max{Ri-(i-1)/N}, I from 1 to N Sample statistic – D=max{D+,D-}
Find critical value, Dalpha If D>Dalpha, reject H0
P-Values Significance level (alpha) – prob of falsely reject
H0 Higher the p-value, the better the fit is
Anderson Darling Weighted average of the squared differences
between observed and hypothesized distributions
Weight function: 1/F(x)*(1-F(x))
Lecture 8 – Logic Elements
General Functions Math functions
+ - * / Mod ** INC, DEC EXP(), LN(), Sqrt() Rand(), Round() FORMAT() Real(0, Trunc
Distribution Functions Discrete:
BI(n,p) GEO(p) P(frequency): poisson
Continuous E(m) – exponential G(a,b): Gamma(shape, scale) U(m, hr): Uniform(mean, half range) N(m,s): Normal(mean, stdev)
Actions and Statements General Actions
Activate, Animate, Debug, Display, DynPlot, Log Pause, report, reset Return, send, sound, trace
General Control Statements If. Then. Else Begin End, Break, Do..Until, Do.. While, Goto
General Options Stop, graphic, prompt
System Functions General
Cap, contents, freecaps, freeunits, entries, units Percentop, percentUtil, timeused Clock, CalMin, CalHour, Calday…. ArrayDims
Entity-specific: Groupqty, resqty, ownedresource Resource-Specific: Last, Next Downtime-Specific: Down, DTLeft, ForLocation Cost: GetCost, GetResRate, IncEntCost
Entity/Resource Related Operation Statements Resource related (Free, Get, Jointly Get, Use) Entity-Related (Accum, Group, create, route,
move, move for, wait, wait until, match) Distinguishing Entities
Method 1: Multiple entities Method 2: Attributes Method 3: Priorities
Lecture 9
Resources General: human labor,
special tools, perform processing on entities, maintain locations and resources, etc
Transporters: human labor, AGV, forklift, etc. To move entities from one location to another
Static: Do not move virtually (stay where they are created during the animation)
Dynamic: Do not have a fixed place to stay, move on a network path
Path Networks Paths of motion for resources
Using Resources USE: get and use resources
for specified period of time GET: Get resources as mad
available JOINTLY GET: Get none
until all requested resources are available at once
FREE: Release resource
Lecture 10 – Path Networks and Dynamic Resources
Path Networks Used to having dynamic
resources move on them Entities move themselves
– can be assigned to move on a path network as well as in move logic
Types: Passing, non-passing, and crane
Using Dynamic Resources USE, GET, JOINTLY GET
are used the same way as in the static resources
MOVE WITH: gets the available resource, use it to move the entity from one location to another
Lecture 11 – Random Number Generators
ProModel Distribution Functions Continuous including
Uniform: RAND(X) is uniform [0,x) Uniform: U(a,b), a=mean, b=half-range Normal: N(a,b), a=mean, b=standard deviation
Discrete Binomial: BI(a,b) Geometric: Geo(a) Poisson: P(a), a=mean
Stream A long circular list of ‘random’ numbers Numbers picked from list in order Usually numbers are uniform (0,1) How streams affect Simulations?
Outcome 1: The same system seems different Outcome 2: The better system seems worse
Random Number RN streams created by RNG RNG ideas
Random time Fractional part of square roots of prime numbers Pseudo-random number generators
A good RNG produces RN fast, long cycle, replicable, repeatable
X0 is called the seed – starting point
Linear Congruential Method: Iterate: Xi+1 = (A*Xi+C) mod M
A- multiplier Xo – seed (starting point) C – Increment M – Modulus (large prime number)
Tests for Pseudo Random Numbers Uniformity (order doesn’t matter) Independence (order does matter)
Uniformity Test Null: H0: Xi’s ~ U(0,1) Alternative: H1: Xis not U(0,1)
Chi-squared goodness of fit Kolmogorov Smirov goodness of fit (preferred)
Independence Test Ho: Xis are independent, H1: Xis not
independent Alpha=P(type I error) = P(reject H0|H0 is
true) Alpha is commonly chosen to be 0.1 or 0.05 Two-tallied, alpha is halved
Chi-squared Goodness of fit H0: Ris ~ U(0,1), H1: Ris not U(0,1)
Runs test for independence H0: Ris are independentt/H1: are not
independent
Lecture 12 – Routing/debugging
Advanced Routing Locations – Rules Processing – Routing – Rule ROUTE Statement
Incoming Entities Oldest by Priority – waiting longest Random Least available capacity Last selected location – Oldest by
priority Highest Attribute value/Lowest
Queuing for Output No Queuing – entities that have
completed their operations are free to process any routing logic independent from other entities that have finished their operations
FIFO LIFO By Type Highest/lowest attribute
Trace Lists events happening in the
simulation Can check “trace” option under
simulation/options to start trace automatically when the simulation starts
Debug DEBUG statement brings up
ProModel’s debugger Step through logic one statement at a
time and examine the values of variables and attributes
WAIT UNTIL statement WAIT UNTIL <condition>
Delays processing for the current block of statements until condition is true
Can use variables, arrays, location attributes
Cannot use system functions, entity attributes
Homework 1
Spaghetti dinner simulation Activities
Fill pan with water Heat water Cook Noodles Drain Noodles Wait 5 minutes for
noodles to cool
Events Turn on water Turn off water Turn on stove Water boils Add noodles to water Turn off stove Start draining noodles Start eating
State variables Temperature of water,
location of noodles, time
Homework 2
Q1 IAT: Lookup(Rand(), CDF, Time
between Arrivals) Service Time: Lookup(Rand(),
CDF, Service Time) Drive in Departure Time:
IF(Drive-in Served = “YES”, MAX(Arrival Time, Sum of Previous Departure times) + Service Time, -1)
Drive in served: IF(Arrival Time > LARGE(Previous Departure times), “Yes”, “No”)
Q2 – service station with 3 available spots, FIFO, no spots, leave service Entities: Customers Attributes: Arrival time, car type,
how much money they spend Events: Arrival of customer (A),
departure of a customer (D) Activities: Customer being waited,
being served Event Notice
Event notice (Ai,t): the ithcustomer arrived at time t.
Event notice (Di,t): the ith
customer departed at time t. System States:
LQ(t): customers in queue at the service station
LS(t): 1 or 0 indicating worker being busy or idle.
Homework 3 – ProModel
Good.
Homework 4
Homework 5 – ProModel
If pizza is bad more than twice – throw away Attribute: Fail_Pizza Variable: GoodPizza
Move Logic: INC GoodPizza, INC Fail_Pizza
RULE: TRM – If Fail_Times < 2, 1
Trashcan - if Fail_Times = 2
Homework 6 – ProModel
Homework 6 Continued