410 likes | 691 Views
SIMULATION EXAMPLES. Simulation Examples. Monte-Carlo (Static) Simulation Estimating profit on a sale promotion Newsvendor Problem Estimating the value of p Approximating Integrals Dynamic System Simulation Queueing systems M/U/1 G/G/1 Inventory systems
E N D
Simulation Examples • Monte-Carlo (Static) Simulation • Estimating profit on a sale promotion • Newsvendor Problem • Estimating the value of p • Approximating Integrals • Dynamic System Simulation • Queueing systems • M/U/1 • G/G/1 • Inventory systems • Periodic Review, Order-up-to-Level inventory control
Estimating pvalue X, Y ~ uniform (0,1) Estimate p value by simulation 1 p/4 1 0
Approximating Integrals Consider the integral Making the substitution we get where
Approximating Integrals Let Y ~ uniform(0,1) Approximate the integral by simulation
Queueing systems Entities Calling Population …… Server Waiting Line (Queue) Finite vs Infinite One server vs multiple server One line vs Multiple lines
Queueing examples System Entity Server Hospital Patient Doctor, Nurse Manufacturing Customer order Machine Food Store Purchased grocery Cashier Bank Client Clerk Computer Job CPU or disk Communication Link Data Package Data Channel
Characteristics • Interarrival and Service Times • Exponential (M) • Deterministic (D) • Erlang (E) • General (G) • Queue discipline • First Come/In First Served/Out (FCFS/FIFO) • Last Come/In First Served/Out (LCFS/LIFO) • Earliest Due Date (EDD) • System Capacity • Number of Servers
Analysis Methods • Queueing Theory (Analytical) • Simulation • Performance Measures • Average Waiting Time • Maximum Waiting Time • Average Number of Entities in the System • Maximum Number of Entities in the System • Server Utilization • Average System Time • Maximum System Time
Events • Arrival Event – entry of a unit into the system • Departure Event – completion of service on a unit • Failure Event – server failure • Repair Event – server repair
Arrival Event Arrival event Schedule next arrival Increase number in the system L(t)=L(t)+1 Is server busy? NO YES Make server busy Increase entity number in queue B(t)=1 Q(t)=Q(t)+1 Set service time & schedule departure
Service Completion Event Departure event Decrease number in system L(t)=L(t)-1 NO Is queue empty? YES Decrease number in queue Make server idle Q(t)=Q(t)-1 B(t)=0 Set service time & scheduled departure for entity in service
Simulation by Hand • Run simulation for 20 • minutes to find • Average Waiting Time • Average Queue Length • Average Utilization
t = 4.41, Arrival of Part 5 5 4 3 2
Finishing Up • Average waiting time in queue: • Time-average number in queue: • Utilization of drill press:
Inventory systems • When to order? • How much to order? • Costs • Holding Cost • Ordering Cost • Shortage Cost • Performance Measures • Total Cost • Total Profit
Elements of Inventory Systems • Entity • Commodity • Events • Demand • Inventory Review • Order Arrival (Replenishment) Occur simultaneously when lead time is zero
Elements of Inventory Systems • State Variables • Inventory level • Time to next review • Time to next replenishment • Input • Demand • Lead Times • Cost Info (holding, shortage, and ordering costs) • Inventory Policy Parameters (Decision Variables) • Output • Total Costs • Average Inventory • Number of Shortages
Demand Event Demand Event D(t) Generate demand size Decrement inventory I(t) = I(t) - D(t) Schedule the next demand event
Order Arrival Event Order Arrival Event I(t) = I(t) + Q Increment Inventory
Inventory Review Event Inventory review event Determine Q Determine lead-time Schedule the next order arrival & review events
Order-Up-To-Level, Periodic Review (M,N) Policy • M is fixed, N is fixed, Q varies
(M,N) Policy Example • Review period N=5 days, Order-up-to level M=11 units • Beginning inventory = 3 units • 8 units scheduled to arrive in two days • Holding cost h = $1 per unit per day • Shortage cost s = $2 per unit per day • Ordering cost K = $10 per order Order arrival t 1 2 3 • Question: based on 5 cycles of simulation, calculate • Average ending units in inventory • The number of days shortage condition existed • Total cost
INPUT DATA 1. Demand Distribution 2. Lead Time Distribution
Z Z M N Z1 * Z2 * N M HOW TO OPTIMIZE (M & N?) Simulation Optimization Z = objective function = f (cost, end. Inv., ...) TRY DIFFERENT M, N VALUES