Skip to content

Commit 819fa7b

Browse files
author
Sara Raquel Freitas Fontes
committed
added fly in
1 parent 43b895a commit 819fa7b

5 files changed

Lines changed: 1832 additions & 0 deletions

File tree

Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
# 🛩️ Fly-in — Drone System Rules
2+
3+
# 📍 Zone System
4+
5+
Every map is composed of connected zones.
6+
7+
![Fly-in Example Map](../assets/img/fly-in_example_map.png)
8+
9+
Each zone belongs to one of the following types:
10+
11+
---
12+
13+
| Zone Type | Description | Movement Cost | Special Rules |
14+
|---|---|---|---|
15+
| 🟢 `normal` | Default zone type | `1 turn` | - Default capacity: `1 drone`<br>- Drones may enter, leave and wait |
16+
| 🔴 `restricted` | Sensitive or dangerous zone | `2 turns` | - Drone occupies the connection during transit<br>- Drone MUST arrive next turn<br>- Cannot stop or wait mid-connection<br>- Movement should not start if destination becomes unavailable |
17+
| 🟡 `priority` | Preferred routing zone | `1 turn` | - Should be prioritized during pathfinding<br>- Behaves like a normal zone regarding occupancy |
18+
|`blocked` | Inaccessible zone || - Drones cannot enter<br>- Drones cannot cross<br>- Any route using it is invalid |
19+
20+
---
21+
22+
# 📦 Zone Capacity Rules
23+
24+
| Rule | Description |
25+
|---|---|
26+
| Default capacity | Every zone supports `1 drone` unless specified otherwise |
27+
| Custom capacity | Zones may define `max_drones=N` |
28+
| Capacity restriction | A drone cannot enter a full zone |
29+
| Simultaneous occupancy | Allowed only if capacity permits |
30+
31+
Example:
32+
33+
```txt
34+
hub: corridorA 4 3 [max_drones=2]
35+
```
36+
37+
Meaning:
38+
39+
```txt
40+
Up to 2 drones may occupy the zone simultaneously.
41+
```
42+
43+
---
44+
45+
# ✅ Special Zones
46+
47+
| Zone | Special Behaviour |
48+
|---|---|
49+
| `start_hub` | Unlimited drones may occupy it initially |
50+
| `end_hub` | Unlimited drones may arrive and delivered drones stop being tracked |
51+
52+
---
53+
54+
# 🔗 Connection Rules
55+
56+
Connections define possible movement paths.
57+
58+
Example:
59+
60+
```txt
61+
connection: A-B
62+
```
63+
64+
---
65+
66+
# ↔️ Bidirectional Connections
67+
68+
All connections are:
69+
70+
- bidirectional
71+
72+
Meaning:
73+
74+
```txt
75+
A-B
76+
```
77+
78+
allows:
79+
80+
- A → B
81+
- B → A
82+
83+
---
84+
85+
# 🚫 Invalid Connections
86+
87+
Connections are invalid if:
88+
89+
- one zone does not exist
90+
- duplicated connection exists
91+
- syntax is invalid
92+
93+
The following are duplicates:
94+
95+
```txt
96+
A-B
97+
B-A
98+
```
99+
100+
---
101+
102+
# 📦 Connection Capacity
103+
104+
Connections may define:
105+
106+
```txt
107+
[max_link_capacity=N]
108+
```
109+
110+
Example:
111+
112+
```txt
113+
connection: A-B [max_link_capacity=2]
114+
```
115+
116+
Meaning:
117+
118+
```txt
119+
Only 2 drones may traverse this connection simultaneously.
120+
```
121+
122+
---
123+
124+
# 🚨 Connection Restrictions
125+
126+
A drone cannot use a connection if:
127+
128+
- its capacity would be exceeded
129+
- another movement rule would be violated
130+
131+
---
132+
133+
# ⏱️ Turn System
134+
135+
The simulation is turn-based.
136+
137+
At every turn, each drone may:
138+
139+
- move
140+
- wait
141+
- continue restricted-zone transit
142+
143+
---
144+
145+
# 🚶 Movement Costs
146+
147+
| Destination Zone | Cost | Notes |
148+
|---|---|---|
149+
| `normal` | `1 turn` | Immediate movement |
150+
| `priority` | `1 turn` | Should be preferred during pathfinding |
151+
| `restricted` | `2 turns` | Drone occupies connection during transit |
152+
| `blocked` || Cannot be entered |
153+
154+
---
155+
156+
# 🛫 Restricted Movement Rules
157+
158+
Restricted movement behaves differently from normal movement.
159+
160+
## Turn 1
161+
162+
The drone enters transit state.
163+
164+
Example:
165+
166+
```txt
167+
D1-A-B
168+
```
169+
170+
---
171+
172+
## Turn 2
173+
174+
The drone MUST arrive at destination.
175+
176+
The drone cannot:
177+
178+
- cancel movement
179+
- wait on the connection
180+
- pause transit
181+
182+
---
183+
184+
# 🔄 Simultaneous Movement Rules
185+
186+
Multiple drones may move during the same turn.
187+
188+
BUT:
189+
190+
- zone capacities must be respected
191+
- connection capacities must be respected
192+
- collisions must not happen
193+
194+
---
195+
196+
# 🚨 Occupancy Rules
197+
198+
Two drones cannot:
199+
200+
- enter the same zone simultaneously
201+
202+
unless:
203+
204+
```txt
205+
max_drones > 1
206+
```
207+
208+
---
209+
210+
# 🔓 Freeing Space
211+
212+
When a drone leaves a zone:
213+
214+
- that space becomes available during the same turn
215+
216+
This means movement scheduling matters.
217+
218+
---
219+
220+
# 🧠 Pathfinding Logic Rules
221+
222+
The routing system must consider:
223+
224+
- shortest paths
225+
- movement costs
226+
- restricted zones
227+
- priority zones
228+
- occupancy limits
229+
- connection limits
230+
- simultaneous drone movement
231+
232+
---
233+
234+
# 🚫 Invalid Drone Behaviour
235+
236+
A drone must never:
237+
238+
- enter blocked zones
239+
- exceed zone capacity
240+
- exceed connection capacity
241+
- remain inside restricted transit longer than allowed
242+
- teleport
243+
- skip turns illegally
244+
- use undefined connections
245+
246+
---
247+
248+
# 📄 Output Rules
249+
250+
Every line represents:
251+
252+
```txt
253+
1 simulation turn
254+
```
255+
256+
Format:
257+
258+
```txt
259+
D<ID>-<destination>
260+
```
261+
262+
Example:
263+
264+
```txt
265+
D1-roof1 D2-corridorA
266+
```
267+
268+
---
269+
270+
# 🛫 Restricted Transit Output
271+
272+
While travelling toward restricted zones:
273+
274+
```txt
275+
D<ID>-<connection>
276+
```
277+
278+
may be displayed.
279+
280+
Example:
281+
282+
```txt
283+
D1-A-B
284+
```
285+
286+
---
287+
288+
# 🏁 End Conditions
289+
290+
Simulation ends only when:
291+
292+
- every drone reaches `end_hub`
293+
294+
Delivered drones:
295+
296+
- are removed from active simulation tracking.
297+
298+
---
299+
300+
# 🎯 Optimization Goal
301+
302+
Main objective:
303+
304+
```txt
305+
Minimize total simulation turns
306+
```
307+
308+
The algorithm should:
309+
310+
- maximize throughput
311+
- reduce waiting
312+
- avoid deadlocks
313+
- distribute drones efficiently across paths

0 commit comments

Comments
 (0)