How bkhnk48/pps works
Project type and purpose
• This is a standalone Python‐based path‐planning simulation tool (an “open‐source tool” rather than a web app or microservice).
File structure
Top-level:
• main.py, connect.py, config.py, filter.py – the orchestration and utility scripts
• components/ – pre-processing and input converters
• controller/ – core orchestration classes (SimulationEngine, GraphProcessor, node/edge/event generators, time‐window controller, restriction controller)
• model/ – domain models (Node, Edge, Graph, Person, AGV, Event, Lobby, Logger, NXSolution) plus two submodules:
– forecasting_model_module/ – ML forecasting integration
– hallway_simulator_module/ – compiled OpenGL C++ simulator binaries for x86_64 and ARM64
• data/ – JSON configuration
• output_B_solver*/ – solver output snapshots
• requirements.txt, README.md, sonar properties, tests
Key README insights
• Requires Python 3.10+, OpenGL 4.6+, and a compiled C++ hallway simulator
• User interacts via CLI prompts in main.py
• Three solver choices: external LINK II, parallel network‐simplex, or NetworkX
• Optional call to hallway simulator (sfm)
Main components
a. CLI front end (main.py)
b. Configuration loader (config.py + data/configuration.json)
c. Input converter/preprocessor (components/convert_file.py + filter.py)
d. Controller layer (SimulationEngine):
• NodeGenerator, EdgeGenerator, EventGenerator → build raw graphs
• GraphProcessor → augment graph, apply restrictions, time‐window logic
• RestrictionController & TimeWindowController → enforce constraints
e. Solver engines:
• LINK II (external)
• Parallel network‐simplex (in Python)
• NetworkX (imported library)
f. Forecasting model (forecasting_model_module/ForecastingModel.py)
g. Hallway simulator (hallway_simulator_module/app external binary)
h. Domain model classes (model/*.py) for AGV, Person, Graph, NXSolution, Logger, etc.
i. Output writer (Logger + output_B_solver directories)
Relationships and data flows
• User → CLI front end → loads config and input file
• CLI → Components → raw graph data → Controller → domain Graph object
• Controller invokes ForecastingModel → adjusts event timings
• Controller invokes Solver engine → returns route assignments as NXSolution
• If “run sfm” chosen → Controller calls external hallway_simulator_module/app, passing solution
• Simulator returns visual/metrics → aggregated by Logger
• Final schedules written to output_B_solver/ and displayed on CLI
Architectural patterns and design principles
• Layered architecture: CLI → Preprocessing → Controller → Model → External/Solver modules
• Clear separation of concerns: components handle I/O, controller handles orchestration, model holds data structures
• Plug-in extensibility: solver engines are interchangeable, forecasting and simulator are optional modules
• Use of external binaries wrapped in Python for high‐performance simulation