Skip to content

Concurrent delivery system simulation implemented using Design Patterns.

Notifications You must be signed in to change notification settings

bilbisli/DeliveryCompany

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeliveryCompany

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).

Program Features:

  1. System Creation Panel:
    • Number of Post Office Branches.
    • Number of Trucks per Post Office Branch.
    • Number of Packages to create throughout the simulation.
  2. Start - starts the simulation.
  3. Stop - pauses the simulation.
  4. Resume - resumes the simulation.
  5. All Packages Info - displays a table of informing the current state of all the created packages.
  6. Branch Info - package information of a specific branch.
  7. CloneBranch - deep copies a selected branch.
  8. Resume - resumes the simulation.
  9. Restore - restores the simulation to the initial settings and runs it.
  10. Report - creates a text log file logging the trace of all the packages created and opens it to be viewed.

Design Patterns used:

  1. Thread-safe Singleton + DCL - the MainOffice is a singleton secured by Double-Checked Locking (DCL - another pattern).
  2. Prototype & Clone - the Branches are a prototype that are cloned when CloneBranch is operated.
  3. Memento - restoring the simulation uses the memento pattern which stores the initial state and reloads it upon request.
  4. Thread Pool - the Customers are managed with a thread pool
  5. Observer-Listener - MainOffice is an observer and Branches, Customers & Trucks are observables.
  6. Read/Write Lock - reading & writing to the report file is managed by a read/write lock.
  7. Producer-Consumer - the packages are produced and 'consumed' (dispatched) based on this pattern.

Program Simulation Demo:

delivery_company_sim_demo.mov

About

Concurrent delivery system simulation implemented using Design Patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published