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