0% found this document useful (0 votes)
13 views6 pages

hw1 Key

The document provides a written assignment for a modeling and simulation course. It contains 4 questions regarding a single-server queueing system: 1) defining terms and plotting/computing metrics, 2) simulating additional events, 3) summarizing the simulation ending early, and 4) introducing premature customer departures and simulating subsequent events. The student provides detailed answers showing their work for each part of the assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

hw1 Key

The document provides a written assignment for a modeling and simulation course. It contains 4 questions regarding a single-server queueing system: 1) defining terms and plotting/computing metrics, 2) simulating additional events, 3) summarizing the simulation ending early, and 4) introducing premature customer departures and simulating subsequent events. The student provides detailed answers showing their work for each part of the assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CSCI 410: Modeling and Simulation

Written Assignment 1 Key


(103 pts in total)

1. For the single-server queueing system in Section 1.4, define L(t) to be the total number of customers
in the system at time t (including the queue and the customer in service at time t, if any).
(a) (4 pts) Is it true that L(t) = Q(t) + 1? Why or why not? If not, correct the right side of the
equation. You may use the functions defined in Section 1.4.
(b) (5 pts) For the same realization considered for the hand simulation in Section 1.4.2, make a plot
of L(t) vs. t (similar to Figs. 1.5 and 1.6) between times 0 and T(6).
(c) (4 pts) From your plot in part (b), compute 𝑙̂(6) = the time-average number of customers in the
system during the time interval [0, T(t)]. Show the expressions for computation, mimicking
Equations 1.2 and 1.3.
(d) (2 pts) What is 𝑙̂(6) estimating?
Answer:
(a) L(t) = Q(t) + 1 is not true. When the server is idle and the queue is empty, L(t) = 0 < Q(t) + 1 = 1.
The right side should be L(t) = Q(t) + B(t), where B(t) is defined on Page 16 in the textbook.
(b)
(c) 𝑙̂(6) = ((0.4 – 0) × 0 + (1.6 – 0.4) × 1 + (2.1 – 1.6) × 2 + (2.4 – 2.1) × 3 + (3.1 – 2.4) × 2 + (3.3 – 3.1)
× 1 + (3.8 – 3.1) × 0 + (4.0 – 3.8) × 1 + (4.9 – 4.0) × 2 + (5.6 – 4.9) × 1 + (5.8 – 5.6) × 2 + (7.2 – 5.8)
× 3 + (8.6 – 7.2) × 4) / 8.6 = 17.6 / 8.6  2.05

(d) 𝑙̂(6) estimates the expected number of customers in the system.

2. (20 pts, 4 pts for each event) Suppose the list of interarrival and service times in Section 1.4.2 is
augmented by the following items: A10 = 0.6, A11 = 1.1, A12 = 1.5, A13 = 0.8, S7 = 2.0, S8 = 2.5. Assume
the simulation stops when the 7th customer leaves the system. Show the system state, simulation
clock, event list and statistical counters as in Figure 1.7 after processing each even since simulation
time of 8.6.
Answer:
Event 1: (Clock = 9.1)
Arrival time = 9.1: Event list:
System: 5.6 (in server), 5.8, 7.2, 9.1 (in A = 9.7 (= 9.1 + A10 = 9.1 + 0.6), D = 9.2
queue) Statistical counters:
System state: Number delayed = 6
Server status = 1 Total delay = 5.7
Number in Queue = 3 Area under Q(t) = 10.9 (= 9.9 + (9.1 – 8.6) × 2)
Time of arrival = 5.8, 7.2, 9.1 Area under B(t) = 8.2 (= 7.7 + (9.1 – 8.6) × 1)
Time of last event = 9.1

Event 2: (Clock = 9.2)


Departure time = 9.2: Event list:
System: 5.8 (in server), 7.2, 9.1 (in queue) A = 9.7, D = 11.2 (= 9.2 + S7 = 9.2 + 2.0)
System state: Statistical counters:
Server status = 1 Number delayed = 7
Number in Queue = 2 Total delay = 9.1 (= 5.7 + (9.2 – 5.8))
Time of arrival = 7.2, 9.1 Area under Q(t) = 11.2 (= 10.9 + (9.2 – 9.1) × 3)
Time of last event = 9.2 Area under B(t) = 8.3 (= 8.2 + (9.2 – 9.1) × 1)

Event 3: (Clock = 9.7)


Arrival time = 9.7: Event list:
System: 5.8 (in server), 7.2, 9.1, 9.7 (in A = 10.8 (= 9.7 + A11 = 9.7 + 1.1), D = 11.2
queue) Statistical counters:
System state: Number delayed = 7
Server status = 1 Total delay = 9.1
Number in Queue = 3 Area under Q(t) = 12.2 (= 11.2 +(9.7 – 9.2) × 2)
Time of arrival = 7.2, 9.1, 9.7 Area under B(t) = 8.8 (= 8.3 + (9.7 – 9.2) × 1)
Time of last event = 9.7

Event 4: (Clock = 10.8)


Arrival time = 10.8: Event list:
System: 5.8 (in server), 7.2, 9.1, 9.7, 10.8 A = 12.3 ((= 10.8 + A12 = 10.8 + 1.5), D = 11.2
(in queue) Statistical counters:
System state: Number delayed = 7
Server status = 1 Total delay = 9.1
Number in Queue = 4 Area under Q(t) = 15.5 (= 12.2 + (10.8 – 9.7) × 3)
Time of arrival = 7.2, 9.1, 9.7, 10.8 Area under B(t) = 9.9 (= 8.8 + (10.8 – 9.7) × 1)
Time of last event = 10.8

Event 5: (Clock = 11.2) (the 7th customer leaves the system)


Departure time = 11.2: Event list:
System: 7.2 (in server), 9.1, 9.7, 10.8 (in A = 12.3, D = 13.7 (= 11.2 + S8 = 11.2 + 2.5)
queue) Statistical counters:
System state: Number delayed = 8
Server status = 1 Total delay = 13.1 (= 9.1 + (11.2 – 7.2))
Number in Queue = 3 Area under Q(t) = 17.1 (= 15.5 + (11.2 – 10.8) × 4)
Time of arrival = 9.1, 9.7, 10.8 Area under B(t) = 10.3 (= 9.9 + (11.2 – 10.8) × 1)
Time of last event = 11.2

3. (4 pts) Suppose the simulation in section 1.4 stops at simulation time of 8.1. Show the system state,
simulation clock, event list and statistical counters at the end of the simulation.
Answer:
System state: Event list:
Server status = 1 A = 9.1, D = 8.6
Number in Queue = 3 Statistical counters:
Time of arrival = 5.6, 5.8, 7.2 Number delayed = 5
Time of last event = 7.2 Total delay = 2.7
Clock = 8.1 Area under Q(t) = 5.7
Area under B(t) = 6.3

4. For the single-server queueing system in Section 1.4, suppose a customer leaves the system without
being served after staying in the queue for 0.2 or more units of time.
(a) (4 pts) What new events must be introduced?
(b) (60 pts, 4 pts for each event) Show the system state, simulation clock and event list after each
event until the end of the simulation. The simulation finishes at simulation time of 9.0.
Answer:
(a) A new event of "Pre-mature departure" (meaning departure without being serviced) must be
introduced.
(b)
Event 1: (Clock = 0.4)
Arrival time = 0.4: Event list: (P: Premature departure)
System: 0.4 (in server) A = 1.6, D = 2.4, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 1
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0
Time of last event = 0.4 Area under B(t) = 0
Event 2: (Clock = 1.6)
Arrival time = 1.6: Event list:
System: 0.4 (in server), 1.6 (in queue) A = 2.1, D = 2.4, P = 1.8
System state: Statistical counters:
Server status = 1 Number delayed = 1
Number in Queue = 1 Total delay = 0
Time of arrival = 1.6 Area under Q(t) = 0
Time of last event = 0.4 Area under B(t) = 1.2 (= (1.6 – 0.4) × 1)

Event 3: (Clock = 1.8)


Premature departure time = 1.8: Event list:
System: 0.4 (in server) A = 2.1, D = 2.4, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 1
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.2 (= (1.8 – 1.6) × 1)
Time of last event = 1.8 Area under B(t) = 1.4 (= 1.2 + (1.8 – 1.6) × 1)

Event 4: (Clock = 2.1)


Arrival time = 2.1: Event list:
System: 0.4 (in server), 2.1 (in queue) A = 3.8, D = 2.4, P = 2.3
System state: Statistical counters:
Server status = 1 Number delayed = 1
Number in Queue = 1 Total delay = 0
Time of arrival = 2.1 Area under Q(t) = 0.2
Time of last event = 2.1 Area under B(t) = 1.7 (= 1.4 + (2.1 - 1.8) × 1)

Event 5: (Clock = 2.3)


Premature departure time = 2.3: Event list:
System: 0.4 (in server) A = 3.8, D = 2.4, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 1
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.2 + (2.3 – 2.1) × 1 = 0.4
Time of last event = 2.3 Area under B(t) = 1.7 + (2.3 – 2.1) × 1 = 1.9

Event 6: (Clock = 2.4)


Departure time = 2.4: Event list:
System: idle A = 3.8, D = ∞, P = ∞
System state: Statistical counters:
Server status = 0 Number delayed = 1
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.4
Time of last event = 2.4 Area under B(t) = 1.9 + (2.4 – 2.3) × 1 = 2.0

Event 7: (Clock = 3.8)


Arrival time = 3.8: Event list:
System: 3.8 (in server) A = 4.0, D = 4.9, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 2
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.4
Time of last event = 3.8 Area under B(t) = 2.0

Event 8: (Clock = 4.0)


Arrival time = 4.0: Event list:
System: 3.8 (in server), 4.0 (in queue) A = 5.6, D = 4.9, P = 4.2
System state: Statistical counters:
Server status = 1 Number delayed = 2
Number in Queue = 1 Total delay = 0
Time of arrival = 4.0 Area under Q(t) = 0.4
Time of last event = 4.0 Area under B(t) = 2.0 + (4.0 – 3.8) × 1 = 2.2

Event 9: (Clock = 4.2)


Premature departure time = 4.2: Event list:
System: 3.8 (in server) A = 5.6, D = 4.9, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 2
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.4 + (4.2 – 4.0) × 1 = 0.6
Time of last event = 4.2 Area under B(t) = 2.2 + (4.2 – 4.0) × 1 = 2.4

Event 10: (Clock = 4.9)


Departure time = 4.9: Event list:
System: idle A = 5.6, D = ∞, P = ∞
System state: Statistical counters:
Server status = 0 Number delayed = 2
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.6
Time of last event = 4.9 Area under B(t) = 2.4 + (4.9 - 4.2) × 1 = 3.1

Event 11: (Clock = 5.6)


Arrival time = 5.6: Event list:
System: 5.6 (in server) A = 5.8, D = 9.2, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.6
Time of last event = 5.6 Area under B(t) = 3.1

Event 12: (Clock = 5.8)


Arrival time = 5.8: Event list:
System: 5.6 (in server), 5.8 (in queue) A = 7.2, D = 9.2, P = 6.0
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 1 Total delay = 0
Time of arrival = 5.8 Area under Q(t) = 0.6
Time of last event = 5.8 Area under B(t) = 3.1 + (5.8 – 5.6) × 1 = 3.3

Event 13: (Clock = 6.0)


Premature departure time = 6.0: Event list:
System: 5.6 (in server) A = 7.2, D = 9.2, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.6 + (6.0 – 5.8) × 1 = 0.8
Time of last event = 6.0 Area under B(t) = 3.3 + (6.0 - 5.8) × 1 = 3.5

Event 14: (Clock = 7.2)


Arrival time = 7.2: Event list:
System: 5.6 (in server), 7.2 (in queue) A = 9.1, D = 9.2, P = 7.4
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 1 Total delay = 0
Time of arrival = 7.2 Area under Q(t) = 0.8
Time of last event = 7.2 Area under B(t) = 3.5 + (7.2 – 6.0) × 1 = 4.7

Event 15: (Clock = 7.4)


Premature departure time = 7.4: Event list:
System: 5.6 (in server) A = 9.1, D = 9.2, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 0.8 + (7.4 – 7.2) × 1 = 1.0
Time of last event = 7.4 Area under B(t) = 4.7 + (7.4 – 7.2) × 1 = 4.9

The following event is optional.

Event 16: (Clock = 9.0)


Simulation end time = 9.0: Event list:
System: 5.6 (in server) A = 9.1, D = 9.2, P = ∞
System state: Statistical counters:
Server status = 1 Number delayed = 3
Number in Queue = 0 Total delay = 0
Time of arrival = (None) Area under Q(t) = 1.0
Time of last event = 9.0 Area under B(t) = 4.9 + (9.0 – 7.4) × 1 = 6.5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy