How sumannam/devs-python works
Project Type Analysis
This is a specialized simulation framework implementing the DEVS formalism, with multiple example projects focusing on pipe monitoring systems and nuclear facility simulations.
Main Architectural Components
A. Core DEVS Framework (src/ directory):
• Model Components
• ATOMIC_MODELS.py
• COUPLED_MODELS.py
• MODELS.py
• Simulation Engine
• SIMULATORS.py
• CO_ORDINATORS.py
• ROOT_CO_ORDINATORS.py
• Communication
• MESSAGE.py
• PORT.py
• COUPLING.py
• Support Components
• ENTITIES.py
• CONTENT.py
• util.py
B. Example Projects Structure:
• Configuration (config.py)
• Model Base (mbase/)
• Coupling Base (coupbase/)
• Test Base (tbase/)
• Integration with External Systems (kafka_producer.py)
┌─────────────────────────────────────┐
• Application Layer │
• (FukushimaNuclearPipe, PipeLeaking)│
• ┤
• DEVS Framework Layer │
• ┤
• Infrastructure Layer │
• ┘
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
• Models │ ─> │ Simulation │ ─> │ Output │
• Hierarchy │ │ Engine │ │ Handlers │
• ┘ └─────────────┘ └─────────────┘
Key Architectural Patterns to Highlight
┌─────────────────────────────────────────────────┐
• DEVS Hierarchy │
• ┬─────────────────┬────────────────┤
• Atomic │ Coupled │ Root │
• Models │ Models │ Coordinator │
• ┬───┴────────┬────────┴────────┬───────┘
• v v v
┌─────────────────────────────────────────────────┐
• Simulation Engine │
• (Processors, Coordinators, Simulators) │
• ┘
Implementation Details
• Message passing mechanisms
• Model state transitions
• External system interfaces (Kafka)
• Test framework integration
• Configuration management