This project displays a concurrent delivery system simulation implemented using Design Patterns.
- Docs are available in the doc folder (can be viewed by
index.html
).
- System Creation Panel:
- Number of Post Office Branches.
- Number of Trucks per Post Office Branch.
- Number of Packages to create throughout the simulation.
- Start - starts the simulation.
- Stop - pauses the simulation.
- Resume - resumes the simulation.
- All Packages Info - displays a table of informing the current state of all the created packages.
- Branch Info - package information of a specific branch.
- CloneBranch - deep copies a selected branch.
- Resume - resumes the simulation.
- Restore - restores the simulation to the initial settings and runs it.
- Report - creates a text log file logging the trace of all the packages created and opens it to be viewed.
- Thread-safe Singleton + DCL - the MainOffice is a singleton secured by Double-Checked Locking (DCL - another pattern).
- Prototype & Clone - the Branches are a prototype that are cloned when CloneBranch is operated.
- Memento - restoring the simulation uses the memento pattern which stores the initial state and reloads it upon request.
- Thread Pool - the Customers are managed with a thread pool
- Observer-Listener - MainOffice is an observer and Branches, Customers & Trucks are observables.
- Read/Write Lock - reading & writing to the report file is managed by a read/write lock.
- Producer-Consumer - the packages are produced and 'consumed' (dispatched) based on this pattern.