Simulator System¶
Understanding how the simulation engine coordinates drones, turns and movement rules in Fly-in.
Table of Contents¶
- What is the Simulator?
- Main Responsibilities
- Simulation State
- Drone Lifecycle
- Turn System
- Occupancy Tracking
- Capacity Management
- Waiting States
- Movement Validation
- Path Updates
- End Conditions
- Simulator vs PathFinder
- Mental Model
1ī¸âŖ What is the Simulator?¶
The Simulator is the component responsible for:
coordinating all drone activity
While other systems may:
- load map data
- validate inputs
- calculate routes
the Simulator controls:
what happens each turn
Think of it as the system that applies the project rules and keeps the simulation progressing.
2ī¸âŖ Main Responsibilities¶
The Simulator typically manages:
- đŠī¸ drone movement
- âąī¸ turn progression
- đĻ occupancy tracking
- đĻ rule enforcement
- đ output generation
3ī¸âŖ Simulation State¶
During execution, the Simulator keeps track of information such as:
current_turn = 7
active_drones = [...]
occupied_zones = {...}
occupied_links = {...}
The exact implementation may differ, but the idea remains the same:
store everything needed to make decisions
4ī¸âŖ Drone Lifecycle¶
A drone normally moves through several states.
Created
â
Waiting
â
Moving
â
Waiting (if required)
â
Moving again
â
Delivered
Not every drone will follow exactly the same route, but they all follow the same simulation rules.
5ī¸âŖ Turn System¶
Fly-in is a:
turn-based simulation
Each turn represents a small step of time.
Example:
Turn 1
D1 -> A
D2 -> B
Turn 2
D1 -> C
D2 -> D
The Simulator evaluates every active drone and decides what can happen during that turn.
A simulation turn usually follows:
Check drones
â
Validate movement
â
Move drones
â
Update occupancy
â
Store turn result
The exact implementation may vary.
The important concept is:
all rules are applied consistently
6ī¸âŖ Occupancy Tracking¶
To avoid conflicts, the Simulator usually tracks:
- occupied zones
- occupied connections
- active movements
Example:
Zone A
ââ D1
ââ D2
Without occupancy tracking, capacity rules cannot be enforced.
7ī¸âŖ Capacity Management¶
Many simulations include limits such as:
Maximum drones per zone
or
Maximum drones per connection
Before a movement happens, those limits may need to be checked.
8ī¸âŖ Waiting States¶
Sometimes a drone cannot move immediately.
Possible reasons:
- destination unavailable
- connection unavailable
- special movement rules
- temporary congestion
In these situations the Simulator may decide:
wait this turn
Waiting is a normal part of scheduling.
9ī¸âŖ Movement Validation¶
Before moving a drone, several questions may need to be answered.
â Is the destination valid?
â Is there enough capacity?
â Can the connection be used?
â Does a valid route still exist?
Only after validation can the movement be applied.
đ Path Updates¶
Routes are not always permanent.
As the simulation changes:
- occupancy changes
- capacities change
- available routes may change
Because of this, a route may need to be recalculated during execution.
1ī¸âŖ1ī¸âŖ End Conditions¶
The simulation ends when:
all drones have been delivered
Example:
D1 â
D2 â
D3 â
D4 â
No active drones remain.
1ī¸âŖ2ī¸âŖ Simulator vs PathFinder¶
These systems solve different problems.
đ§ PathFinder¶
Answers:
Where should the drone go?
đŽ Simulator¶
Answers:
Can the drone move right now?
Separating these responsibilities makes the project easier to understand, test and maintain.
1ī¸âŖ3ī¸âŖ Mental Model¶
Think of the PathFinder as:
GPS navigation
It suggests routes.
Think of the Simulator as:
Air traffic control
It decides:
Who can move
When they can move
Whether the movement is valid