LIVE STATUS
Current Phase
-
Signal Countdown
-s
Queue Length
0
Cars Passed
0
Green Roads
-
Red Roads
-
PERFORMANCE
-
Efficiency Score
0%
Throughput
0
Average Waiting Time
0s
LIVE TRENDS
Queue
Throughput
SIMULATION MODE
Mode: Normal Traffic
Mode Intensity
Medium
Scenario Presets
Pick a preset to simulate a real-world traffic pattern.
ROAD-WISE TRAFFIC
TRAFFIC CONTROLS
Emergency Priority
No priority active
Manual Density
GRAPH MODEL
Phases: -
Conflict edges: -
Current phase explanation: -
ABOUT & GUIDE
1. Quick Start
Use this flow for a complete run:
- Press START to begin traffic movement and signal rotation.
- Press STOP to pause while preserving current state.
- Press RESET to clear traffic and restart from a clean state.
2. Simulation Modes
- Normal Traffic: stable everyday pattern with moderate load.
- Balanced Traffic: similar demand on all four roads.
- Heavy Traffic: high inflow and longer queues.
- Random Traffic: continuously varying demand.
Mode Intensity summarizes expected pressure level.
3. Scenario Presets
- Peak Hour: office-time surge with strong directional demand.
- School Exit: short controlled burst around one time window.
- Event Dispersal: one random road gets higher focus each run while others continue moving with lower load.
Presets automatically apply a mode and road-wise density profile.
4. Traffic Controls
- Emergency Priority: temporarily prioritizes one road when urgent flow is needed.
- Manual Density +/-: increase or decrease incoming demand per road in real time.
5. Live Status Metrics
- Current Phase: active signal phase selected by graph-coloring logic.
- Signal Countdown: remaining time before next phase switch.
- Queue Length: total waiting vehicles across roads.
- Cars Passed: cumulative successful crossings.
- Green Roads / Red Roads: currently allowed and blocked directions.
6. Performance Metrics
- Efficiency Rating: qualitative result from system throughput behavior.
- Efficiency Score: numeric score for easier comparison.
- Throughput: vehicles passing per minute.
- Average Waiting Time: average delay before movement starts.
- Live Trends: queue and throughput history over time.
7. Road-wise Traffic Card
- Shows per-road Queue, Density, and current signal color state.
- Useful for verifying if manual controls and scenarios are behaving correctly.
8. Graph Model (Discrete Maths Core)
- Each direction (North, South, East, West) is treated as a vertex.
- Unsafe simultaneous pairs are modeled as conflict edges.
- Graph coloring groups non-conflicting vertices into safe phases.
- The active colored group is turned green together to avoid collisions.
9. Applications of Discrete Mathematics Used
- Set Representation: roads, cars, active roads, inactive roads, and conflict pairs are modeled as finite sets.
- Set Partitioning: each signal phase partitions directions into two disjoint sets: green (allowed) and red (blocked).
- Binary Relations: conflict relation defines which two roads cannot be green together at the same time.
- Graph Theory: the junction is represented as a graph where roads are vertices and conflicts are edges.
- Subgraph Reasoning: currently active roads form a conflict-free subset (independent set behavior).
- Graph Coloring: colors represent safe phases; roads with the same color can move simultaneously.
- Chromatic Insight: minimum required phase groups are derived from graph conflicts.
- Functions and Mapping: mode/scenario selection maps to density values and spawn configurations.
- Function Composition: scenario + mode + manual density updates combine to produce final traffic behavior.
- Finite State Machine: the controller transitions through phase states with deterministic timing rules.
- Discrete Time Steps: simulation updates in fixed ticks, making movement and decisions discrete.
- Propositional Logic: if-then rule checks drive decisions (priority, conflicts, waiting, switching).
- Constraint Satisfaction: safety constraints prevent invalid signal combinations that could cause collisions.
- Combinatorics (Counting): queue length, cars passed, and road-wise waiting counts are discrete cardinalities.
- Discrete Optimization: throughput maximization and waiting-time reduction guide signal effectiveness.
- Weighted Random Choice: probabilistic spawning uses density-based weights to model realistic arrivals.
- Case-Based Discrete Modeling: Peak Hour, School Exit, and Event Dispersal encode real situations as finite rule sets.