aboutsummaryrefslogtreecommitdiff
path: root/advtrains/occupation.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:09:04 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:09:04 +0100
commit0518fbbf3ae388631cb21f238068f2a6b3785972 (patch)
tree0a70cd4c3a480d32af005f7e1b67cd0e1c30976f /advtrains/occupation.lua
parentb71c72b4ab4d50c8f3a3a6ccbe15427548e1d2ff (diff)
parent2157a7ef365902162336540d89d91049c5d3a394 (diff)
downloadadvtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.tar.gz
advtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.tar.bz2
advtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.zip
Merge branch 'master' of https://git.bananach.space/advtrains
Diffstat (limited to 'advtrains/occupation.lua')
-rw-r--r--advtrains/occupation.lua43
1 files changed, 1 insertions, 42 deletions
diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua
index f5c7d88..da60278 100644
--- a/advtrains/occupation.lua
+++ b/advtrains/occupation.lua
@@ -1,48 +1,7 @@
-- occupation.lua
--[[
Collects and manages positions where trains occupy and/or reserve/require space
-THIS SECTION ABOVE IS OUTDATED, look below
-
-Zone diagram of a train:
- |___| |___| --> Direction of travel
- oo oo+oo oo
-=|=======|===|===========|===|=======|===================|========|===
- |SafetyB|CpB| Train |CpF|SafetyF| Brake |Aware |
-[1] [2] [3] [4] [5] [6] [7] [8]
-
-ID|Name |Desc
- 0 Free Zone that was occupied before, which has now been left
- 1 Train Zone where the train actually is.
- 2 SafetyB Safety zone behind the train. extends 4m
- 3 SafetyF Safety zone in front of the train. extends 4m
- If a train is about to enter this zone, immediately brake it down to 2
- 4 CpB Backside coupling zone. If the coupling zones of 2 trains overlap, they can be coupled
- 5 CpF Frontside coupling zone
- 6 Brake Brake distance of the train. Extends to the point ~5 nodes in front
- of the point where the train would stop if it would regularily brake now.
- 7 Aware Awareness zone. Extends 10-20 nodes beyond the Brake zone
- Whenever any of the non-aware zones of other trains are detected here, the train will start to brake.
-
-Table format:
-occ[y][x][z] = {
- [1] = train 1 id
- [2] = train 1 ZoneID
-// [3] = entry seqnum*
- ...
- [2n-1] = train n id
- [2n ] = train n ZoneID
-// [3n-2] = train n id
-// [3n-1] = train n ZoneID
-// [3n ] = entry seqnum*
-}
-occ_chg[n] = {
- pos = vector,
- train_id,
- old_val, (0 when entry did not exist before)
- new_val, (0 when entry was deleted)
-}
-
----------------------
+
It turned out that, especially for the TSS, some more, even overlapping zones are required.
Packing those into a data structure would just become a huge mess!
Instead, this occupation system will store the path indices of positions in the corresponding.