Simulation of systems Steps in Simulation Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model Translation No Verified ? Yes No No Validated ? Yes Experimental Design Production run and analysis Yes More Run? No Yes Documentation and reporting 02-08-2021 Implementation Simulation example Simulating single server queue Queuing systems There are many situations in daily life when a queue is formed. Queuing theory is the mathematical study of waiting lines and it is very useful for analyzing the procedure of queuing of daily life of human being. Queuing theory applies not only in day to day life but also in sequence of computer programming, networks, medical field, banking sectors etc. The Process Flow in Queue Calling Population Waiting Line Server Arrival Event Processing Arrival Event Server Busy? No Unit Enters Service Yes Unit Enters Queue Departure Event Processing Departure Event No Server Idle Time Begins Yes Remove one waiting unit from the Queue and start service Anyone Waiting? Simulating a Single Server Queuing System To simulate the functioning of a single server queuing system Simulate Entity – An object of Interest in a system The assumptions are The calling population is infinite The time between arrivals is known and is uniformly distributed between limits (say 1 to 8 min) Mean time between arrivals is 4.5 min The service time is known and is uniformly distributed between limits (say 1 to 6) Mean service time is 3.5 min Mean service time is less than mean time between arrivals hence the system is stable The system capacity is infinite FIFO is the rule 02-08-2021 Modelling & Simulation β Application Areas 1 Random Number 0-0.067 0.068- 0.133 0.134-0.333 0.334-0.600 0.601-0.867 0.868-0.9999 Modelling & Simulation β Application Areas 1 0 5 0 0 5 5 2 8 8 3 8 0 11 3 3 4 5 6 7 8 9 10 3 2 7 7 5 1 2 2 11 13 20 27 32 33 35 37 6 3 3 6 6 2 3 2 11 17 20 27 33 39 41 44 0 4 0 0 1 6 6 7 17 20 23 33 39 41 44 46 6 7 3 6 7 8 9 9 3 4 Solution…………. Customer 1 2 3 4 5 6 7 8 9 10 Inter Arrival Time (min) Arrival Time Service Time (Clock) (min) 0 8 11 13 20 27 32 33 35 37 8 3 2 7 7 5 1 2 2 02-08-2021 5 3 6 3 3 6 6 2 3 2 Time Service Begins (clock) 0 8 11 17 20 27 33 39 41 44 Waiting Time Time Time Customer Server (min) Service Ends Spends in the Idle Time (Clock) System (min) (min) 0 0 0 4 0 0 1 6 6 7 24 5 11 17 20 23 33 39 41 44 46 5 3 6 7 3 6 7 8 9 9 63 3 4 7 Metrics of the Queueing System Average Waiting Time Probability that the customer has to wait = = = Server Utilisation = = Mean Waiting Time = = Mean time in system = = = Total time spent in queue / Total Number of Customers 24/10 = 2.4 min No. of Customers who wait / Total No. of Customers 2/10 = 0.2 1-(Server Idle Time /Total Time) 1-(7/46) = 95.65 % Total waiting time / No. of Customers who wait 24/5 = 4.8 min Total time in system / Total No of Customers 63/10 = 6.3 min Simulating single server queue Simulating Single sever queuing systems Let us consider an example of super market, who have a single billing counter, following are observations and assumption of the market • The calling population is infinite • Mean time of arrival of a customer is uniformly distributed between 2 to 7min, with mean of 5 min Inter arrival Time Probability 2 3 4 5 6 7 0.10 0,15 0,20 0.25 0.20 0.10 Service time per customer is uniformly distributed between 1 to 6 min with mean of 4 min Service Time 1 2 3 4 5 6 Probability 0.10 0,10 0,20 0.30 0.20 0.10 • Since the mean customer arrival time is more than service time of each customer, hence the system is stable • First Come First Serve rule is applicable 02-08-2021 DR. ASHISH KUMAR SAXENA Simulation Process flow Problem statement: Simulate the billing process of the supermarket, and find out efficiency of the system over finite event Customer arrival to billing counter Stand in Waiting line Billing Process There are two events, in which system stage changes with time. • Arrival event • Departure event Between these two events the complete process take place ……. So we should discuss these two events in detail. 02-08-2021 Simulating single server queue Arrival Event Processing Customer arrival at billing counter No Billing Counter busy ? Yes Customer Billing Process start Customer need to stand in queue Departure Event Processing Customer billing Complete No Anyone waiting in queue? Yes Server Idle time start 1 Customer start billing, 1 reduced from queue Details of Queue system Random Number Random Numbe 0-0.01 0-0.01 0.11-0.25 0.11-0.20 0.26-0.45 0.21-0.40 0.46-0.7 0.41-0.7 0.71-0.90 0.71-0.90 0.91-0.99 0.91-0.99 Customer Inter Arrival Time (min) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Random Number Arrival Time (Clock) Random Service Time Waiting Time Number Time (min) Service Time (min) Service Begins Ends (clock) (Clock) Time Server Customer Idle Spends in Time the System (min) (min) Probability that the customer has to wait = ππ ππ ππ’π π‘πππππ π€βπ βππ π‘π π€πππ‘ πππ‘ππ ππ’ππππ ππ ππ’π π‘πππππ = Service utilization probability =1 − ππππ£ππ πΌπππ π‘πππ πππ‘ππ π‘πππ Average time per customer spend in system πππ‘ππ π‘πππ ππ’π π‘ππππ π ππππ ππ π π¦π π‘ππ = πππ‘ππ ππ’ππππ ππ ππ’π π‘πππππ Mean service time = πππ‘ππ π πππ£πππ π‘πππ πππ‘ππ ππ’ππππ ππ ππ’π π‘πππππ Average time between arrivals = Mean waiting time = πππ‘ππ πππ‘πππππππ£ππ π‘πππ πππ‘ππ ππ’ππππ ππ ππ’π π‘πππππ πππ‘ππ π€πππ‘πππ π‘πππ ππ ππ’π π‘πππππ πππ‘ππ ππ’ππππ ππ ππ’π π‘πππππ π€πππ‘ππ ππ π π¦π π‘ππ Example 2: Call Center Problem Multi Server Queueing Problem • Consider a Call Center where technical staff take calls and provide service • Two technical support people (server) exists •Able more experienced, provides service faster •Baker new, provides service slower • Current rule: Able gets call if both people are idle • Other possible rules: •Baker gets call if both are idle •Call is assigned randomly to Able and Baker • Goal of study: Find out how well the current rule works! Caller Nr. Rando Interarr Arrival m ival Time Numbe Time r When Able Avail.. When Baker Avail. Server Rando Service Chosen m Time Numbe r Time Service Begins Able‘s Service Compl. Time Caller Time in Delay System /waitin gTime in System 1 - - 0 0 - A 0.36 3 0 3 0 3 2 0.567 2 2 3 2 B 0.72 5 2 7 0 5 Example 3: Simulation of Inventory System A dealer of electrical appliances has a certain product for which the probability distribution of demand per day and the probability distribution of the lead-time, developed by past records are as shown in the following tables. Probability distribution of lead demand Probability distribution of lead time The various costs involved are, Ordering Cost = Rs. 50 per order Holding Cost = Rs.1 per unit per day Shortage Cost = Rs. 20 per unit per day The dealer is interested in having an inventory policy with two parameters, the reorder point and the order quantity, i.e., at what level of existing inventory should an order be placed and the number of units to be ordered. Evaluate a simulation plan for 15 days, which calls for a reorder quantity of 35 units and a re-order level of 20 units, with a beginning inventory balance of 45 units. Simulation of Inventory System Day Random Number Demand Random Number (Lead Time) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 58 45 43 36 46 46 70 32 12 40 51 59 54 16 68 7 6 6 6 6 6 7 5 4 6 6 7 6 4 7 73 21 - Lead Time Inventory Quantity (Days) at the end received of the day 3 2 - 45 38 32 26 20 14 8 1 31 27 21 15 8 2 33 26 35 35 - Ordering Cost Holding Cost Shortage Cost 50 50 100 38 32 26 20 14 8 36 31 27 21 15 8 37 33 26 - 02-08-2021 02-08-2021 Any Questions ? 02-08-2021 DR. ASHISH KUMAR SAXENA