Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

DESim Example with Hash Table Starter Code

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 1.86 sec, absolute running time: 0.13 sec, cpu time: 0.07 sec, memory peak: 3 Mb, absolute service time: 2,03 sec 
edit mode |  history  | discussion
*** Discrete Event Simulation Example for ECE 2574 ***

Adding 40 events...
[0] Adding event: Alice Zuckerman, Event Time: 66, Duration: 1, Event type: ARRIVAL
[0] Adding event: Ambroise Ghosh, Event Time: 13, Duration: 6, Event type: ARRIVAL
[0] Adding event: Alice Lee, Event Time: 62, Duration: 5, Event type: ARRIVAL
[0] Adding event: Bert Smith, Event Time: 6, Duration: 9, Event type: ARRIVAL
[0] Adding event: Alice Ghosh, Event Time: 55, Duration: 5, Event type: ARRIVAL
[0] Adding event: Larry Zhang, Event Time: 6, Duration: 6, Event type: ARRIVAL
[0] Adding event: Alice Zhang, Event Time: 1, Duration: 8, Event type: ARRIVAL
[0] Adding event: Ambroise Ghosh, Event Time: 14, Duration: 3, Event type: ARRIVAL
[0] Adding event: Larry Lee, Event Time: 53, Duration: 10, Event type: ARRIVAL
[0] Adding event: Ambroise Ghosh, Event Time: 47, Duration: 8, Event type: ARRIVAL
[0] Adding event: Bert Jones, Event Time: 94, Duration: 9, Event type: ARRIVAL
[0] Adding event: Bert Zhang, Event Time: 98, Duration: 3, Event type: ARRIVAL
[0] Adding event: Bert Jones, Event Time: 80, Duration: 5, Event type: ARRIVAL
[0] Adding event: Emily Lee, Event Time: 52, Duration: 8, Event type: ARRIVAL
[0] Adding event: Alice Ghosh, Event Time: 17, Duration: 9, Event type: ARRIVAL
[0] Adding event: Alice Smith, Event Time: 1, Duration: 1, Event type: ARRIVAL
[0] Adding event: Larry Lee, Event Time: 42, Duration: 2, Event type: ARRIVAL
[0] Adding event: Bert Ghosh, Event Time: 1, Duration: 1, Event type: ARRIVAL
[0] Adding event: Ambroise Jones, Event Time: 1, Duration: 1, Event type: ARRIVAL
[0] Adding event: Emily Zuckerman, Event Time: 33, Duration: 6, Event type: ARRIVAL
[0] Adding event: Alice Zuckerman, Event Time: 100, Duration: 4, Event type: ARRIVAL
[0] Adding event: Ambroise Smith, Event Time: 53, Duration: 7, Event type: ARRIVAL
[0] Adding event: Denise Ghosh, Event Time: 15, Duration: 6, Event type: ARRIVAL
[0] Adding event: Bert Zhang, Event Time: 39, Duration: 3, Event type: ARRIVAL
[0] Adding event: Alice Zuckerman, Event Time: 4, Duration: 3, Event type: ARRIVAL
[0] Adding event: Denise Jones, Event Time: 93, Duration: 8, Event type: ARRIVAL
[0] Adding event: Bert Ghosh, Event Time: 18, Duration: 2, Event type: ARRIVAL
[0] Adding event: Alice Jones, Event Time: 19, Duration: 5, Event type: ARRIVAL
[0] Adding event: Ambroise Zuckerman, Event Time: 51, Duration: 9, Event type: ARRIVAL
[0] Adding event: Bert Zhang, Event Time: 35, Duration: 2, Event type: ARRIVAL
[0] Adding event: Denise Zhang, Event Time: 68, Duration: 4, Event type: ARRIVAL
[0] Adding event: Alice Jones, Event Time: 36, Duration: 9, Event type: ARRIVAL
[0] Adding event: Alice Lee, Event Time: 31, Duration: 9, Event type: ARRIVAL
[0] Adding event: Denise Ghosh, Event Time: 76, Duration: 6, Event type: ARRIVAL
[0] Adding event: Ambroise Zhang, Event Time: 89, Duration: 10, Event type: ARRIVAL
[0] Adding event: Emily Lee, Event Time: 56, Duration: 5, Event type: ARRIVAL
[0] Adding event: Ambroise Jones, Event Time: 64, Duration: 1, Event type: ARRIVAL
[0] Adding event: Alice Smith, Event Time: 32, Duration: 4, Event type: ARRIVAL
[0] Adding event: Alice Lee, Event Time: 9, Duration: 3, Event type: ARRIVAL
[0] Adding event: Denise Smith, Event Time: 14, Duration: 7, Event type: ARRIVAL

Running the DES...
[1] Adding event: Alice Zhang, Event Time: 9, Duration: 8, Event type: DEPARTURE
[1] Alice Zhang not found in customer DB 
[1] Current number of tellers available: 1
[1] Adding event: Alice Smith, Event Time: 2, Duration: 1, Event type: DEPARTURE
[1] Alice Smith not found in customer DB 
[1] Current number of tellers available: 0
[1] Adding bank queue customer: Bert Ghosh, Event Time: 1, Duration: 1, Event type: ARRIVAL
[1] Adding bank queue customer: Ambroise Jones, Event Time: 1, Duration: 1, Event type: ARRIVAL
[2] Adding event: Bert Ghosh, Event Time: 3, Duration: 1, Event type: DEPARTURE
[2] Bert Ghosh not found in customer DB 
[3] Adding event: Ambroise Jones, Event Time: 4, Duration: 1, Event type: DEPARTURE
[3] Ambroise Jones not found in customer DB 
[4] Adding bank queue customer: Alice Zuckerman, Event Time: 4, Duration: 3, Event type: ARRIVAL
[4] Adding event: Alice Zuckerman, Event Time: 7, Duration: 3, Event type: DEPARTURE
[4] Alice Zuckerman not found in customer DB 
[6] Adding bank queue customer: Bert Smith, Event Time: 6, Duration: 9, Event type: ARRIVAL
[6] Adding bank queue customer: Larry Zhang, Event Time: 6, Duration: 6, Event type: ARRIVAL
[7] Adding event: Bert Smith, Event Time: 16, Duration: 9, Event type: DEPARTURE
[7] Bert Smith not found in customer DB 
[9] Adding bank queue customer: Alice Lee, Event Time: 9, Duration: 3, Event type: ARRIVAL
[9] Adding event: Larry Zhang, Event Time: 15, Duration: 6, Event type: DEPARTURE
[9] Larry Zhang not found in customer DB 
[13] Adding bank queue customer: Ambroise Ghosh, Event Time: 13, Duration: 6, Event type: ARRIVAL
[14] Adding bank queue customer: Ambroise Ghosh, Event Time: 14, Duration: 3, Event type: ARRIVAL
[14] Adding bank queue customer: Denise Smith, Event Time: 14, Duration: 7, Event type: ARRIVAL
[15] Adding event: Alice Lee, Event Time: 18, Duration: 3, Event type: DEPARTURE
[15] Alice Lee not found in customer DB 
[15] Adding bank queue customer: Denise Ghosh, Event Time: 15, Duration: 6, Event type: ARRIVAL
[16] Adding event: Ambroise Ghosh, Event Time: 22, Duration: 6, Event type: DEPARTURE
[16] Ambroise Ghosh not found in customer DB 
[17] Adding bank queue customer: Alice Ghosh, Event Time: 17, Duration: 9, Event type: ARRIVAL
[18] Adding bank queue customer: Bert Ghosh, Event Time: 18, Duration: 2, Event type: ARRIVAL
[18] Adding event: Ambroise Ghosh, Event Time: 21, Duration: 3, Event type: DEPARTURE
[18] Ambroise Ghosh found in customer DB 
[19] Adding bank queue customer: Alice Jones, Event Time: 19, Duration: 5, Event type: ARRIVAL
[21] Adding event: Denise Smith, Event Time: 28, Duration: 7, Event type: DEPARTURE
[21] Denise Smith not found in customer DB 
[22] Adding event: Denise Ghosh, Event Time: 28, Duration: 6, Event type: DEPARTURE
[22] Denise Ghosh not found in customer DB 
[28] Adding event: Alice Ghosh, Event Time: 37, Duration: 9, Event type: DEPARTURE
[28] Alice Ghosh not found in customer DB 
[28] Adding event: Bert Ghosh, Event Time: 30, Duration: 2, Event type: DEPARTURE
[28] Bert Ghosh found in customer DB 
[30] Adding event: Alice Jones, Event Time: 35, Duration: 5, Event type: DEPARTURE
[30] Alice Jones not found in customer DB 
[31] Adding bank queue customer: Alice Lee, Event Time: 31, Duration: 9, Event type: ARRIVAL
[32] Adding bank queue customer: Alice Smith, Event Time: 32, Duration: 4, Event type: ARRIVAL
[33] Adding bank queue customer: Emily Zuckerman, Event Time: 33, Duration: 6, Event type: ARRIVAL
[35] Adding bank queue customer: Bert Zhang, Event Time: 35, Duration: 2, Event type: ARRIVAL
[35] Adding event: Alice Lee, Event Time: 44, Duration: 9, Event type: DEPARTURE
[35] Alice Lee found in customer DB 
[36] Adding bank queue customer: Alice Jones, Event Time: 36, Duration: 9, Event type: ARRIVAL
[37] Adding event: Alice Smith, Event Time: 41, Duration: 4, Event type: DEPARTURE
[37] Alice Smith found in customer DB 
[39] Adding bank queue customer: Bert Zhang, Event Time: 39, Duration: 3, Event type: ARRIVAL
[41] Adding event: Emily Zuckerman, Event Time: 47, Duration: 6, Event type: DEPARTURE
[41] Emily Zuckerman not found in customer DB 
[42] Adding bank queue customer: Larry Lee, Event Time: 42, Duration: 2, Event type: ARRIVAL
[44] Adding event: Bert Zhang, Event Time: 46, Duration: 2, Event type: DEPARTURE
[44] Bert Zhang not found in customer DB 
[46] Adding event: Alice Jones, Event Time: 55, Duration: 9, Event type: DEPARTURE
[46] Alice Jones found in customer DB 
[47] Adding bank queue customer: Ambroise Ghosh, Event Time: 47, Duration: 8, Event type: ARRIVAL
[47] Adding event: Bert Zhang, Event Time: 50, Duration: 3, Event type: DEPARTURE
[47] Bert Zhang found in customer DB 
[50] Adding event: Larry Lee, Event Time: 52, Duration: 2, Event type: DEPARTURE
[50] Larry Lee not found in customer DB 
[51] Adding bank queue customer: Ambroise Zuckerman, Event Time: 51, Duration: 9, Event type: ARRIVAL
[52] Adding event: Ambroise Ghosh, Event Time: 60, Duration: 8, Event type: DEPARTURE
[52] Ambroise Ghosh found in customer DB 
[52] Adding bank queue customer: Emily Lee, Event Time: 52, Duration: 8, Event type: ARRIVAL
[53] Adding bank queue customer: Ambroise Smith, Event Time: 53, Duration: 7, Event type: ARRIVAL
[53] Adding bank queue customer: Larry Lee, Event Time: 53, Duration: 10, Event type: ARRIVAL
[55] Adding bank queue customer: Alice Ghosh, Event Time: 55, Duration: 5, Event type: ARRIVAL
[55] Adding event: Ambroise Zuckerman, Event Time: 64, Duration: 9, Event type: DEPARTURE
[55] Ambroise Zuckerman not found in customer DB 
[56] Adding bank queue customer: Emily Lee, Event Time: 56, Duration: 5, Event type: ARRIVAL
[60] Adding event: Emily Lee, Event Time: 68, Duration: 8, Event type: DEPARTURE
[60] Emily Lee not found in customer DB 
[62] Adding bank queue customer: Alice Lee, Event Time: 62, Duration: 5, Event type: ARRIVAL
[64] Adding event: Ambroise Smith, Event Time: 71, Duration: 7, Event type: DEPARTURE
[64] Ambroise Smith not found in customer DB 
[64] Adding bank queue customer: Ambroise Jones, Event Time: 64, Duration: 1, Event type: ARRIVAL
[66] Adding bank queue customer: Alice Zuckerman, Event Time: 66, Duration: 1, Event type: ARRIVAL
[68] Adding bank queue customer: Denise Zhang, Event Time: 68, Duration: 4, Event type: ARRIVAL
[68] Adding event: Larry Lee, Event Time: 78, Duration: 10, Event type: DEPARTURE
[68] Larry Lee found in customer DB 
[71] Adding event: Alice Ghosh, Event Time: 76, Duration: 5, Event type: DEPARTURE
[71] Alice Ghosh found in customer DB 
[76] Adding bank queue customer: Denise Ghosh, Event Time: 76, Duration: 6, Event type: ARRIVAL
[76] Adding event: Emily Lee, Event Time: 81, Duration: 5, Event type: DEPARTURE
[76] Emily Lee found in customer DB 
[78] Adding event: Alice Lee, Event Time: 83, Duration: 5, Event type: DEPARTURE
[78] Alice Lee found in customer DB 
[80] Adding bank queue customer: Bert Jones, Event Time: 80, Duration: 5, Event type: ARRIVAL
[81] Adding event: Ambroise Jones, Event Time: 82, Duration: 1, Event type: DEPARTURE
[81] Ambroise Jones found in customer DB 
[82] Adding event: Alice Zuckerman, Event Time: 83, Duration: 1, Event type: DEPARTURE
[82] Alice Zuckerman found in customer DB 
[83] Adding event: Denise Zhang, Event Time: 87, Duration: 4, Event type: DEPARTURE
[83] Denise Zhang not found in customer DB 
[83] Adding event: Denise Ghosh, Event Time: 89, Duration: 6, Event type: DEPARTURE
[83] Denise Ghosh found in customer DB 
[87] Adding event: Bert Jones, Event Time: 92, Duration: 5, Event type: DEPARTURE
[87] Bert Jones not found in customer DB 
[89] Adding bank queue customer: Ambroise Zhang, Event Time: 89, Duration: 10, Event type: ARRIVAL
[89] Adding event: Ambroise Zhang, Event Time: 99, Duration: 10, Event type: DEPARTURE
[89] Ambroise Zhang not found in customer DB 
[92] Current number of tellers available: 1
[93] Adding event: Denise Jones, Event Time: 101, Duration: 8, Event type: DEPARTURE
[93] Denise Jones not found in customer DB 
[93] Current number of tellers available: 0
[94] Adding bank queue customer: Bert Jones, Event Time: 94, Duration: 9, Event type: ARRIVAL
[98] Adding bank queue customer: Bert Zhang, Event Time: 98, Duration: 3, Event type: ARRIVAL
[99] Adding event: Bert Jones, Event Time: 108, Duration: 9, Event type: DEPARTURE
[99] Bert Jones found in customer DB 
[100] Adding bank queue customer: Alice Zuckerman, Event Time: 100, Duration: 4, Event type: ARRIVAL
[101] Adding event: Bert Zhang, Event Time: 104, Duration: 3, Event type: DEPARTURE
[101] Bert Zhang found in customer DB 
[104] Adding event: Alice Zuckerman, Event Time: 108, Duration: 4, Event type: DEPARTURE
[104] Alice Zuckerman found in customer DB 
[108] Current number of tellers available: 1
[108] Current number of tellers available: 2

Printing out the customer statistics and teller utilization...
Customer Name: Ambroise Zhang
    Number of transactions: 1
    Total duration: 10
    Total wait time: 0

Customer Name: Bert Jones
    Number of transactions: 2
    Total duration: 14
    Total wait time: 12

Customer Name: Denise Zhang
    Number of transactions: 1
    Total duration: 4
    Total wait time: 15

Customer Name: Larry Lee
    Number of transactions: 2
    Total duration: 12
    Total wait time: 23

Customer Name: Bert Zhang
    Number of transactions: 3
    Total duration: 8
    Total wait time: 20

Customer Name: Alice Ghosh
    Number of transactions: 2
    Total duration: 14
    Total wait time: 27

Customer Name: Alice Lee
    Number of transactions: 3
    Total duration: 17
    Total wait time: 26

Customer Name: Emily Lee
    Number of transactions: 2
    Total duration: 13
    Total wait time: 28

Customer Name: Alice Jones
    Number of transactions: 2
    Total duration: 14
    Total wait time: 21

Customer Name: Bert Smith
    Number of transactions: 1
    Total duration: 9
    Total wait time: 1

Customer Name: Emily Zuckerman
    Number of transactions: 1
    Total duration: 6
    Total wait time: 8

Customer Name: Denise Smith
    Number of transactions: 1
    Total duration: 7
    Total wait time: 7

Customer Name: Denise Ghosh
    Number of transactions: 2
    Total duration: 12
    Total wait time: 14

Customer Name: Alice Zhang
    Number of transactions: 1
    Total duration: 8
    Total wait time: 0

Customer Name: Alice Zuckerman
    Number of transactions: 3
    Total duration: 8
    Total wait time: 20

Customer Name: Ambroise Jones
    Number of transactions: 2
    Total duration: 2
    Total wait time: 19

Customer Name: Ambroise Zuckerman
    Number of transactions: 1
    Total duration: 9
    Total wait time: 4

Customer Name: Larry Zhang
    Number of transactions: 1
    Total duration: 6
    Total wait time: 3

Customer Name: Bert Ghosh
    Number of transactions: 2
    Total duration: 3
    Total wait time: 11

Customer Name: Ambroise Ghosh
    Number of transactions: 3
    Total duration: 17
    Total wait time: 12

Customer Name: Denise Jones
    Number of transactions: 1
    Total duration: 8
    Total wait time: 0

Customer Name: Ambroise Smith
    Number of transactions: 1
    Total duration: 7
    Total wait time: 11

Customer Name: Alice Smith
    Number of transactions: 2
    Total duration: 5
    Total wait time: 5


Total duration scheduled: 213
Total duration simulated: 213

Teller quiting time: 108
Teller utilization: 0.986111