How piergit7/distributedrealtimesystem works
Project type and purpose
• This is a Python-based scheduling simulator / analysis tool.
• It ingests task, budget, and architecture descriptions (CSV files), applies scheduling policies (e.g., BDR, DBF, SRP), simulates execution, and writes out results.
File structure
• Top level:
• src/ – simulator code and core libraries
• data/ – input test cases and output CSVs
• tests/ – unit tests for the simulator
• assignment/ – project brief and a standalone simulator copy (not part of main code base)
• docs/ – usage examples
• environment.yml, pyproject.toml, requirements*.txt – dependency and environment config
• src/ hierarchy:
• src/simulator.py – CLI entry point
• src/analysis.py – post-simulation analysis tools
• src/common/ – core domain models (Task, Job, Component), schedulers, CSV I/O, utilities
README
• Describes how to invoke the simulator from a command line, confirming that the CLI is the main user interface.
Components and interactions
a. Main components:
1) CLI Runner (simulator.py)
2) Input Reader (csvreader.py)
3) Data Models (Task, Job, Component in common/)
4) Scheduler Engine (scheduler.py and policy modules BDR.py, DBF.py, SRPModel.py)
5) Output Writer (csvoutput.py)
6) Analysis Module (analysis.py)
7) Test Harness (tests/test_simulator.py)
8) Data Stores (data/custom/*.csv for inputs, data/simulator_outputs/*.csv for outputs)
b. Relationships and data flow:
• User invokes CLI Runner with a path to a task-file →
• CLI Runner calls Input Reader to parse CSVs into Data Models →
• Models are passed into Scheduler Engine →
• Scheduler executes chosen policy, emits scheduling decisions (Jobs) →
• Output Writer serializes results back to CSV →
• Analysis Module may post-process outputs (optional) →
• Tests exercise the end-to-end flow via the Test Harness.
c. Architectural patterns / design principles:
• Modular separation: I/O, domain model, algorithms, CLI, analysis.
• Strategy pattern for scheduling policies (BDR, DBF, SRP) via interchangeable modules.
• Single Responsibility: each common/*.py handles a focused concern (e.g., csvreader, scheduler).
d. Key technologies and libraries:
• Python 3 runtime (environment.yml, pyproject.toml)
• Standard library modules: csv, argparse, unittest (in tests): no heavy external dependencies.
Don’t overthink—capture every logical module
• Common/ files under a “Domain & Algorithms” container.
• External input/output folders as data sources/sinks.