Skip to content

Commit

Permalink
add interlocking initialization (#329)
Browse files Browse the repository at this point in the history
* added data directory

* added new dependencies

* add PlanPro file

* update toml to refrence git fork

* fix lint and add __init__.py

* add sumo_config_helper

* restructure directories

* changed cords to schwarze Pumpe

* use refactored version of yaramo

* change configs so a new planpro would be generated

* fix lint

* add start_interlocking

* Add test, that runs if not for faults in yaramo

* added another model

* added Signal Generator

* the points are fixed

* fix lint

* add Platform import

* add new version of data

* fix lint

* realy fix lint

* fix typehints

* add right poetry.lock

* changed path acording to project dir structure

* change paths again

* move the example

* return to more complex sumo net

* changes from feedback

* change test according to feedback

* fix lint

* fix poetry lock
  • Loading branch information
Lietze authored Apr 20, 2023
1 parent ee3e0d7 commit 4da78b7
Show file tree
Hide file tree
Showing 38 changed files with 573,313 additions and 148 deletions.
Empty file added data/__init__.py
Empty file.
173,286 changes: 173,286 additions & 0 deletions data/planpro/test_example.ppxml

Large diffs are not rendered by default.

173,286 changes: 173,286 additions & 0 deletions data/planpro/test_with_fixed_points.ppxml

Large diffs are not rendered by default.

173,286 changes: 173,286 additions & 0 deletions data/planpro/test_with_new_yaramo.ppxml

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions data/planpro_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from orm_importer.importer import ORMImporter
from planproexporter import Generator
from railwayroutegenerator.routegenerator import RouteGenerator
from track_signal_generator.generator import TrackSignalGenerator


def generate_planpro():
cordinates = [
(51.5594, 14.3344),
(51.5381, 14.3794),
(51.4829, 14.4130),
(51.5166, 14.3088),
]
polygon = ""
for cord in cordinates:
polygon += str(cord[0]) + " "
polygon += str(cord[1]) + " "
polygon = polygon[:-1]
# This is somewhere west of Schwarze Pumpe.

# Import from OSM/ORM
topology = ORMImporter().run(polygon)

# Generate Signals
# TrackSignalGenerator(topology).place_edge_signals()

# Generate Routes
RouteGenerator(topology).generate_routes()

# Write PlanPro
generator = Generator()
generator.generate(
topology, "BP2022-AP1", "BP2022-AP1", "data/planpro/test_with_fixed_points"
)


if __name__ == "__main__":
generate_planpro()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4,748 changes: 4,748 additions & 0 deletions data/sumo/test_example/sumo-config/test_example.con.xml

Large diffs are not rendered by default.

1,424 changes: 1,424 additions & 0 deletions data/sumo/test_example/sumo-config/test_example.edg.xml

Large diffs are not rendered by default.

11,088 changes: 11,088 additions & 0 deletions data/sumo/test_example/sumo-config/test_example.net.xml

Large diffs are not rendered by default.

380 changes: 380 additions & 0 deletions data/sumo/test_example/sumo-config/test_example.nod.xml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions data/sumo/test_example/sumo-config/test_example.routes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">


<vType id="regio" accel="2.5" decel="1.3" length="20.00" vClass="rail" color="193,18,28" />

<vType id="ice" accel="5" decel="1.3" length="60.00" vClass="rail_electric" color="192,192,192" />

<vType id="cargo" accel="2.5" decel="1.3" length="80.00" vClass="rail" color="30,30,30" />

</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<configuration>
<input>
<net-file value="test_example.net.xml" />
<route-files value="test_example.routes.xml" />
</input>
</configuration>
Loading

0 comments on commit 4da78b7

Please sign in to comment.