Skip to content

FahdSeddik/Truck-Delivery-Company-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 

Repository files navigation

Truck Delivery Company Simulation

This is a simulation of a truck delivery company written in C++. This was made as a University project in the Data Structures and Algorithms course at Faculty of Engineering, Cairo University.

Objects Simulated include:

  • Cargos (3 types): Normal, Special, VIP (N,S,V)
    1. Unique ID
    2. Delivery Distance
    3. Cost
  • Trucks (3 types): Normal, Special, VIP (N,S,V)
    1. Unique ID
    2. Speed
    3. Capacity
    4. Repair time and number of journey before repairing
  • Events:
    1. Ready(R): new cargo to deliver with type, money, deliveryDistance, loading/unloading time.
    2. Cancellation(X): cancel a cargo from waiting normal cargos.
    3. Promotion(P): promote a normal cargo paying extra money.
  • Other:
    1. A normal cargo that waits AutoP days would get automatically promoted to VIP.
    2. A truck that waits MaxW hours without reaching full capacity would start loading and deliver.

Input File

image

Output FIle

image

  • CDT: Cargo delivery time
  • PT: preparation time
  • WT: waiting time
  • TID: truck ID that delivered the cargo

Interface

image

After running the program you will have 3 modes to choose from:

  • Interactive Mode: Would allow you to manually increment hours by pressing Enter.
  • Step-by-Step Mode: Automatically increment hours by 1 each second.
  • Silent Mode: Just produce an output file.

You would then be asked to enter the input file's name aswell as the output file's name

image

Interactive Mode & Step-By-Step Modes

image

Items Displayed:

  • Output format of a truck:
    • TruckID [CargoID,CargoID]
    • Brackets change [] or () or {} depending on truck type (N,S,V)

Current time (Day:Hour): 1:0 This implies day 1 hour 0 of the simulation
0 Waiting Cargos: [] () {} 0 total number of cargos [] for normal () for special {} for VIP
Rest of Items are displayed similarily

Contributors

  • @FahdSeddik
  • @AbdulrahmanEl-Bedewy
  • @amrashraf2001
  • @gaserSami

Releases

No releases published

Packages

No packages published