This project is a comprehensive simulation of a multi-line factory production system, developed for the Algorithms and Data Structures course at Al-Sham Private University (ASPU). It manages order flow, inventory, and production scheduling using advanced data structures to handle real-world constraints and emergencies.
- 🐧 Cross-Platform Support: Fully compatible with both Windows and Linux (Arch) environments using preprocessor directives.
- 📦 Integrated Logistics: Real-time transition from the Production Floor to the Shipping Queue based on priority.
- 🚨 Smart Emergency Recovery: Advanced line breakdown handling that redistributes orders to the least-congested lines.
- ⏱️ Precision Tracking: Every
ProductUnitmaintains a timestamped history of events using standard C++ time libraries.
The system is divided into four main subsystems, each optimized for performance:
-
Structures:
std::list&std::unordered_map. -
Logic: Optimized for
$O(1)$ lookup and$O(1)$ insertion of Urgent/VIP orders into the pending list.
- Structures:
std::vector<std::priority_queue<Order>>. - Logic: Multi-line processing where each line operates as a Max-Heap, ensuring critical orders are never delayed.
- Structures:
std::deque&std::map. - Logic: Uses a Double-Ended Queue for raw material flow and a map for fast auditing of inventory levels.
- Structures:
std::priority_queue. - Logic: A dedicated global queue that receives finished products and organizes them for dispatch based on client priority.
Since the system is now cross-platform, you can compile it easily using g++:
cd FactoryManager
g++ -std=c++17 -o FactoryApp *.cpp
./FactoryApp
cd ~/Desktop/University/Projects/Factory-Simulation-System/FactoryManager
g++ -std=c++17 -o FactoryApp *.cpp && ./FactoryApp
One of the core features is the Line Breakdown Recovery:
- When a line fails, the system automatically redistributes its
priority_queueto other active lines while maintaining the priority order of all units.
The system features a Greedy Load Balancer for breakdowns:
Detects line failure.
Extracts all pending orders.
Scans active lines to find the one with the minimum load.
Moves overflow to the Emergency Line if standard lines exceed capacity.
-
/FactoryManager: Core source code (.cpp,.h). -
.vscode/: Environment configurations for Arch Linux & Windows. -
docs/: Engineering report and UML diagrams.
-
Conditional Compilation: Used
#ifdef _WIN32to ensure the system is portable across different OS environments. -
Input Validation: Implemented a robust
checkIfNumbersystem withtry-catchblocks to prevent runtime crashes from invalid user inputs. -
Resource Management: Optimized the consumption of materials using
WarehouseManagerbefore starting any production line.
- Mahmoud Al-Kowatli (Project Lead & Linux Integration)
- GhaithSalloum1
- HussamAdinAlKayyal
- MajedAnka