Simulation of an event scheduler made of two queues of different priority. One of the classes of customer has higher priority and the system does not mitigate in any form the classical starvation problem
.
The analytical model can be resumed by the following table of events:
Primary Events | Secondary Events |
---|---|
Arrival of Customer of Class 1 | 1 - Schedule next arrival (Random number from 1 to 10) 2 - Test server state Free: Set state to busy Schedule service termination (Random number from 3 to 7) Busy: Schedule event “put customer in queue” |
Arrival of Customer of Class 2 | 1 - Schedule next arrival (Random number from 1 to 5) 2 - Test server state Free: Set state to busy Schedule service termination (Random number from 3 to 7) Busy: Schedule event “put customer in queue” |
Service Termination | 1 - Test waiting queue state Empty: Set server state to “free” Not empty: Remove customer from queue Schedule event “Service termination” (Random number from 3 to 7) |
Java >= 7
To start the application run the class src/EventSchedulerApplication.java
. The simulation results will be directed to the standard output.
- Benardi Nunes - Initial work - Benardi
This project is licensed under the MIT License - see the LICENSE.md file for details