Skip to content

JRTaylord/PA4_JRTaylor

Repository files navigation

PA4_the_murder – Jacob Tutlis – jjtutlis – James Taylor – jrtaylor CS2303 – hw4 - Event Driven Simulation

Abstract: The purpose of this program is to test the difference in efficiency between two types of queues in a bank. The first is having one large line that feeds to the tellers and the second is having each teller have a individual line that the customer will pick based on how long each line is.

How to compile and run: To compile type this in the command line while in the project directory.

make

To clean the project enter

make clean

To run the program you need to enter command line arguments in the format: ./qSim #customers #tellers simulationTime averageServiceTime

customers (int) is the number of customers, tellers(int) is the number of tellers, simulationTime (int)is the max duration of simulation, averageServiceTime (int) is the desired average service time for each customer, and seed (int) is used to control the randomness of the program, the same seed will produce the same outcome, seed is an optional argument. If no seed is entered the program will generate a random seed.

Here is examples of running the program

./qSim 100 4 60 2 3

./qSim 50 2 34 3

Program Structure: This program consists of 4 main classes. The Teller and Customer classes store the required information for each respective class and also inherit the event class. The event class is important because it contains a variable holding the next event. This variable holding the next event allows for the EventQueue class to work, by making events a linked list.

Stats: Our statistics generated so far been consistent in terms of mean processing time, but not standard-deviation. Our standard-deviations have been varying by a large degree.

Borrowed code: For the linked list we followed a tutorial found at:

https://www.codementor.io/codementorteam/a-comprehensive-guide-to-implementation-of-singly-linked-list-using-c_plus_plus-ondlm5azr

To calculate standard deviation we used a function found at: https://www.programiz.com/cpp-programming/examples/standard-deviation

About

Simulation of bank events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published