Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simulations CS2123. What are simulations? Simulations attempt to model a real-world situation to learn before actually making what could be an expensive.

Similar presentations


Presentation on theme: "Simulations CS2123. What are simulations? Simulations attempt to model a real-world situation to learn before actually making what could be an expensive."— Presentation transcript:

1 Simulations CS2123

2 What are simulations? Simulations attempt to model a real-world situation to learn before actually making what could be an expensive change. Frequently, simulations investigate a situation prior to implementing the change. Computer Scientists are sought to provide simulation assistance.

3 Case #1: Space Shuttle Robotic Arm In the 1970s, UTSA had a research contract to help model movement of the very expensive robotic arm. NASA didn’t want the arm to be damaged or damage the shuttle, harming the astronauts. The simulation provided a graphical model of the arm movement and provided graphics with hidden-line filtering. Robotic arm control software could then be modified to understand all movement tolerances.

4 Case #2: Should WGFY add a teller? The “We’ve Got a Fee for You” (WGFY) Bank is hearing many complaints from customers who are waiting in line at their bank. Customers are complaining that they are waiting over 20 minutes Lobby has three tellers, each with a separate queue Due to bank lobby configuration expenses, labor expenses, and customer inconvenience, they would like a simulation to learn the effects of proposed changes Alternative A: change to a single queue serving all tellers ($100K) Alternative B: add another teller ($400K + $60K/year) Alternative C: add another teller and utilize a single queue serving all tellers ($600K + $60K/year)

5 Case #3: Call Center Management A large insurance company needed to improve telephone coverage. Customers were hanging up due to long waits for a service representative during peak times (10 am – 2pm CDT). Hang-up probability (of calls still live) > 5 minutes – 40% between 2 and 5 minutes – 20% < 2 minutes – 5% Company had geographic call centers in each major time zone. PST service representatives only worked with customers on the West coast; MST service representatives only worked with customers in the Rocky Mountain area; CDT service representatives worked with customers in any time zone.

6 Case #3: Call Center Management (cont) Due to labor costs and time to onboard new employees, adding labor is expensive and wouldn’t immediately change the call waiting times. Options (select combinations): Add X employees (X * $100K/year) with impact not realized until after 3 months. Provide automated call-back system ($500K + $400K/year support) During low morning call periods in the MST and PST areas, use MST and PST service representatives to help with the peak in the CST. Licensing requirements would mandate additional training (productivity loss of 1 month per utilized service representative)

7 Case #4: Podunk Intersection Congestion: The City of Podunk needs to determine how to handle congestion at a particular intersection. Should a traffic light be installed or should a roundabout be used? During Peak congestion (7am-9am and 4pm-6pm), traffic queues up to 4-9 vehicles and a wait time of over 1 minute. Alternatives: Traffic Light ($400K + $40K / yr). Average wait times are expected to be 50 seconds during peak due to waiting for a complete light cycle. Roundabout ($600K + $0 / yr). Average wait times are expected to be less than 6 seconds (but it hasn’t been verified).

8 Time-based Event Simulations Cases 2 thru 4 are timed-based event simulations: Need to know: Arrival rates Service time Want to produce (at least): Average waiting time Average queue length Maximum waiting time Maximum queue length Observations of current arrivals (customer at lobby, customer call, vehicles at intersections) can provide arrival rates Observations of service time (teller service, call center service representative service, time to cross intersection) Observations of existing wait time and queue length

9 Time-based Event Simulations Time-based Event List Arrival events are inserted based on information from observations Service completion events are inserted when servicing begins Implementation: Ordered (by time) Linked List with duplicates Clock Next clock value set from time-based event list Implementation: Simple integer value Queues While customers (or widgets ) are waiting, they queue up Used to compute average waiting times, maximum waiting times, average queue length, and maximum queue length Implementation: queue (with additional attributes for statistics) Servers Maintain whether they are busy Associate the server with a queue Trying to take the next customer (or widget) from the queue Widgets Represent the thing that moves through the simulation (customers, vehicles) Implementation: structure (with additional attributes for statistics)

10 Running a Simulation runSimulation routine: Loops through the dynamic list of time-based events Based on the event type, invokes the appropriate capability. Examples: Arrival: arrival enter queue try to seize server Service Completion: release server (and server take’s another widget from queue if possible)

11 Sample runSimulation: single queue, one server generateArrival(sim, 0); while (removeLL(sim->eventList, &event)) { sim->iClock = event.iTime; // advance clock updateStatistics(sim, queueTeller, serverTeller); // if using queue statistics approach b switch(event.eventType); { case EVT_ARRIVAL: arrival(sim, &event.widget); queueUp(sim, queueTeller, &event.widget); seize(sim, queueTeller, serverTeller); break; case EVT_TELLER_COMPLETE: release(sim, queueTeller, serverTeller, &event.widget); leaveSystem(sim, event.widget); break; default: ErrExit(ERR_ALGORITHM, "Unknown event type: %d\n", event.iEventType); }

12 Queue Statistics - average waiting time: approaches Approach A: Gather queue time for each widget. Each widget includes a time in queue (for each queue). On leaving queue: Add the widget’s time to the queue time sum. Add 1 to queue exit widget count. Approach B: Queue maintains weighted sum information. On each clock advancement, add the product of delta time and count of widgets to the weighted sum Add 1 to queue exit widget count.

13 Weighted Sum Example W1 W2 W3 W4 W5 Time 0 12 3 4 56 7 8 9 0 tu 2 tu 4 tu 5 tu 6 tu == 17 Clock Time Weighed Sum = 0 Intv Product = 0*0 1 1*1 3 1*2 5 1*2 11 2*3 15 2*2 17 2*1


Download ppt "Simulations CS2123. What are simulations? Simulations attempt to model a real-world situation to learn before actually making what could be an expensive."

Similar presentations


Ads by Google