Sources: https://github.com/DanteFanaBadia/threading
This document has as purpose to define in big scale all project decision and component.
- Define the technology stack
- Define the solution overview
- Document the reason of the technology selection
- Professor and monitors: to evaluate and get feedbacks from them.
- Peers students: to share knowledge and ideas.
The solution is a traffic light simulation using thread. The main idea behind this is to sync the semaphores, so only one have the green light and the carts avoid collisions.
For the thread synchronization process, we use conditional variable to notify when the thread is available, and the other thread can process with the execution also we follow the architecture of shared memory model to sync the thread information.
References
- Conditional variable: https://docs.python.org/3/library/threading.html#threading.Condition
- Shared Memory Model: https://hpc-tutorials.llnl.gov/posix/designing_threaded_programs/#shared-memory-model
- [*] You have the freedom to place the traffic lights at the points where the desired flow is resolved.
- [*] You have a budget to purchase a maximum of four traffic lights.
- [*] You must check that there are no collisions in the traffic flow.
- [*] You must animate your simulator with black arrows or car figures, giving the sensation of a real flow based on the traffic lights (red, green, yellow).
- [*] You must control the speed of the simulation with three options for the user:
- Fast Simulation.
- Intermediate Simulation
- Slow Simulation.
- [*] The speed of each option must be parameterizable, and the user can adjust the seconds they want for each option (fast, intermediate or slow).
- [*] Consider enabling an option to reset the speed to default values.
- [*] The visual design of your program is free, but it must respond to the flow shown in the previous diagram.
Here is technology stack benchmark and selection.
Decision | Alts | Pros | Cons |
---|---|---|---|
Programming language: Python |
|
|
|
Game engine: Pygame |
|
|
|
Level design toolkit: LDtk |
|
|
|