├── .github
└── workflows
│ └── docker.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── data
├── berlin_net
│ ├── gtfs
│ │ ├── BVG_VBB_bereichsscharf_20190603.zip
│ │ ├── BVG_VBB_bereichsscharf_20200520.zip
│ │ ├── UMBW_Haltestellen_20200520.zip
│ │ ├── berlin.cfg
│ │ └── readme.txt
│ ├── landmarks
│ ├── location_priorities.xml
│ ├── netpatch
│ │ ├── patch.con.xml
│ │ ├── patch.edg.xml
│ │ ├── patch.nod.xml
│ │ ├── patch.tll.xml
│ │ ├── patch_tram.con.xml
│ │ └── patch_tram.edg.xml
│ ├── netpatch_pre
│ │ ├── extra_edges.txt
│ │ └── keep_landmark.txt
│ ├── osm
│ │ ├── berlin_net.osm.xml.gz
│ │ └── berlin_net.typ.xml
│ ├── ptVtypes.xml
│ ├── shapes
│ │ ├── Berlin Verkehrsbezirke (1193 VBz) GK4_zone.ctf
│ │ ├── Berlin Verkehrsbezirke (1193 VBz) GK4_zone.dbf
│ │ ├── Berlin Verkehrsbezirke (1193 VBz) GK4_zone.prj
│ │ ├── Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shp
│ │ ├── Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shx
│ │ ├── Berlin_1223.dbf
│ │ ├── Berlin_1223.prj
│ │ ├── Berlin_1223.shp
│ │ ├── Berlin_1223.shx
│ │ ├── RBS_OD_ORT_1412.cpg
│ │ ├── RBS_OD_ORT_1412.dbf
│ │ ├── RBS_OD_ORT_1412.prj
│ │ ├── RBS_OD_ORT_1412.sbn
│ │ ├── RBS_OD_ORT_1412.sbx
│ │ ├── RBS_OD_ORT_1412.shp
│ │ ├── RBS_OD_ORT_1412.shp.xml
│ │ └── RBS_OD_ORT_1412.shx
│ ├── template_gen0pt.netccfg
│ ├── template_gen1.netccfg
│ └── vtypes.xml
├── jsprit
│ ├── Ladezonen_100m_Duplicates_Filtered_by_BuildingBlocks.csv.gz
│ ├── beschreibung_der_Spaltenparameter (tourLegs).txt
│ ├── generateSUMOTours.py
│ └── tourLegsCharacteristics_UTM.csv.gz
├── mitte_net
│ ├── __init__.py
│ └── setup.py
├── mitte_test
│ ├── __init__.py
│ ├── gtfs
│ ├── landmarks
│ ├── netpatch
│ │ ├── patch.con.xml
│ │ ├── patch.edg.xml
│ │ ├── patch.nod.xml
│ │ ├── patch.tll.xml
│ │ ├── patch_tram.con.xml
│ │ └── patch_tram.edg.xml
│ ├── netpatch_pre
│ │ ├── extra_edges.txt
│ │ └── keep_landmark.txt
│ ├── osm
│ │ ├── berlin_net.typ.xml
│ │ └── osm_bbox.osm.xml.gz
│ ├── ptVtypes.xml
│ ├── shapes
│ ├── template_gen0.netccfg
│ ├── template_gen1.netccfg
│ └── vtypes.xml
├── move_urban
│ ├── __init__.py
│ ├── busspur.con.xml
│ ├── busspur.edg.xml
│ ├── busspur.tll.xml
│ ├── extra_bus.add.xml
│ └── setup.py
└── siemensbahn
│ ├── landmarks
│ ├── pt_siemensbahn_stops.add.xml
│ ├── pt_siemensbahn_vehicles.add.xml
│ ├── setup.py
│ ├── siemensbahn.edg.xml
│ └── siemensbahn.nod.xml
├── docs
└── 20210604LastenheftSUMO_TAPAS.docx
├── postgres_template.tsccfg
├── pyproject.toml
├── requirements.txt
├── setup.cfg
├── sqlite3.tsccfg
├── src
└── tapas_sumo_coupling
│ ├── __init__.py
│ ├── __main__.py
│ ├── assign.py
│ ├── common.py
│ ├── constants.py
│ ├── database.py
│ ├── edgemapper.py
│ ├── emissions.py
│ ├── get_germany_taz.py
│ ├── get_motorway_access.py
│ ├── get_trips.py
│ ├── import_navteq.py
│ ├── install_scenario_templates.py
│ ├── postprocess.py
│ ├── s2t_miv.py
│ ├── s2t_pt.py
│ ├── t2s.py
│ └── tsc_main.py
└── tests
├── runSQLiteTests.bat
├── runSQLiteTests.sh
├── runTests.bat
├── runTests.sh
├── testEnv.bat
└── tsc
├── config.tsc
├── config.tsc.python3
├── config.tsc.sqlite3
├── data
├── 2013y_03m_07d_16h_43m_41s_859ms_limit1000.csv
├── empty.csv
├── initialState.sql
├── minParamSet.sql
├── twoPersonsOnly.csv
├── twoPersonsOnly_walking.csv
└── twoPersonsWrongTaz.csv
├── environment.tsc.sqlite3
├── pre
├── installTemplateDir
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── installTemplateDir_mitte
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── testsuite.tsc
└── testsuite.tsc.daily
├── template
├── data
│ └── test_templates
│ │ ├── __init__.py
│ │ └── mitte_net
│ │ ├── Berlin_1223.taz.xml.gz
│ │ ├── RBS_OD_ORT_1412.taz.xml.gz
│ │ ├── __init__.py
│ │ ├── bidi.taz.xml.gz
│ │ ├── districts.taz.xml.gz
│ │ ├── landmarks.csv.gz
│ │ ├── net.net.xml.gz
│ │ └── vtypes.xml
├── public_transport
│ ├── catalogue.tsc
│ ├── data
│ │ ├── test_templates
│ │ │ └── mitte_net
│ │ │ │ ├── ptVtypes.xml
│ │ │ │ ├── pt_stops.add.xml.gz
│ │ │ │ └── pt_vehicles.add.xml.gz
│ │ └── twoPersonsOnly.csv
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── sharing
│ ├── catalogue.tsc
│ ├── data
│ │ ├── test_templates
│ │ │ └── mitte_net
│ │ │ │ ├── fleet.add.xml
│ │ │ │ └── fleet_stops.add.xml
│ │ └── twoPersonsOnly.csv
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── testsuite.tsc
├── threeIterationsDeleteNonFinal
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── threeIterationsDeleteTemp
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── tscDaemonDatabaseTripsFromDB
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── resultingTripFile.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonDatabaseTripsFromFile
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonEmptyTripsFile
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonEmptyWorkdir
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonRestrictions
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonTripEmissions
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── tscDaemonVTypeMatrix
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
└── walking
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── testsuite.tsc
├── tscDaemonWriteStatusToDB
├── catalogue.tsc
├── errors.tsc
├── output.tsc
└── runner.py
├── tscDaemon_withDB_newSimRequest_missing_template_folder
├── catalogue.tsc
├── errors.tsc
├── output.tsc
└── runner.py
├── tscDaemon_withDB_noSimRequests
├── catalogue.tsc
├── errors.tsc
├── output.tsc
└── runner.py
├── tscdefs.py
├── unitTest
├── catalogue.tsc
├── errors.tsc
├── output.tsc
└── runner.py
└── workdir
├── data
├── scenario_workdir
│ └── mitte_net
│ │ ├── Berlin_1223.taz.xml.gz
│ │ ├── RBS_OD_ORT_1412.taz.xml.gz
│ │ ├── bidi.taz.xml.gz
│ │ ├── districts.taz.xml.gz
│ │ ├── iteration000
│ │ └── trips
│ │ │ └── dummy
│ │ ├── net.net.xml.gz
│ │ └── vtypes.xml
└── test_templates
│ ├── __init__.py
│ └── mitte_net
│ └── .gitkeep
├── get_trips
├── all_pairs
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── resultingAllPairsFile.tsc
│ └── runner.py
├── no_trip_table
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── plain
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── resultingTripFile.tsc
│ └── runner.py
└── testsuite.tsc
├── s2t_miv
├── all_pairs
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ └── runner.py
├── data
│ ├── miv_all_pairs_passenger24.trips.rou.xml.gz
│ └── vehroutes_oneshot_meso.rou.xml
└── testsuite.tsc
├── t2s
├── complete
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── data
│ └── 2013y_11m_08d_14h_44m_44s_356ms_limit100000_negative_departures.csv
├── gawron
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── marouterGawron
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── oneshotGawron
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── rectify
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ └── runner.py
├── rectifyMap
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ └── runner.py
├── scale2
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── testsuite.tsc
└── wrongTaz
│ ├── catalogue.tsc
│ ├── errors.tsc
│ ├── output.tsc
│ ├── rectifiedTrips.tsc
│ ├── runner.py
│ └── sumoTrips.tsc
├── testsuite.tsc
└── tscDaemonWorkdirWithOneIteration
├── catalogue.tsc
├── errors.tsc
├── output.tsc
└── runner.py
/.github/workflows/docker.yml:
--------------------------------------------------------------------------------
1 | name: docker
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 | workflow_dispatch:
8 | schedule:
9 | - cron: '30 0 * * *'
10 |
11 | env:
12 | REGISTRY: ghcr.io
13 | IMAGE_NAME: ${{ github.repository }}
14 |
15 | jobs:
16 | build-and-push-image:
17 | runs-on: ubuntu-latest
18 | permissions:
19 | contents: read
20 | packages: write
21 |
22 | steps:
23 | - name: Checkout repository
24 | uses: actions/checkout@v3
25 |
26 | - name: Log in to the Container registry
27 | uses: docker/login-action@v2
28 | with:
29 | registry: ${{ env.REGISTRY }}
30 | username: ${{ github.actor }}
31 | password: ${{ secrets.GITHUB_TOKEN }}
32 |
33 | - name: Extract metadata (tags, labels) for Docker
34 | id: meta
35 | uses: docker/metadata-action@v4
36 | with:
37 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38 |
39 | - name: Build and push Docker image
40 | uses: docker/build-push-action@v4
41 | with:
42 | context: .
43 | push: true
44 | tags: ${{ steps.meta.outputs.tags }}
45 | labels: ${{ steps.meta.outputs.labels }}
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .idea
3 | __pycache__
4 | *.pyc
5 | /build
6 | /dist
7 | /scenario_templates
8 | /scenario_workdir
9 | /src/tapas_sumo_coupling.egg-info/
10 | /tsc.log
11 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # This Dockerfile installs tsc with the publicly available berlin scenario
2 | # to build this image run the following command
3 | # $ docker build -t tsc - < Dockerfile.ubuntu.git
4 | # to use it run (GUI applications need more work)
5 | # $ docker run -it tsc bash
6 |
7 | FROM ghcr.io/eclipse-sumo/sumo:nightly
8 |
9 | # tsc needs lfs for the old scenarios in data, but currently we only install from sumo-scenarios
10 | #RUN apt-get -y install git-lfs; git lfs install
11 |
12 | RUN cd /opt; git clone --recursive --depth 1 --shallow-submodules https://github.com/DLR-TS/tsc; git clone --recursive --depth 1 --shallow-submodules https://github.com/DLR-TS/sumo-scenarios
13 |
14 | # python packages needed (also listed in requirements.txt but we prefer the ubuntu packages)
15 | RUN apt-get -y install python3-psycopg2
16 |
17 | # ensure up-to-date pip
18 | RUN python3 -m pip install -U pip
19 |
20 | RUN cd /opt/tsc; python3 -m pip install .
21 | #RUN cd /opt/tsc; tsc_install
22 | RUN cd /opt/tsc; tsc_install -p /opt/sumo-scenarios/
23 |
--------------------------------------------------------------------------------
/data/berlin_net/gtfs/BVG_VBB_bereichsscharf_20190603.zip:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7407ec6533cf8167e20d71ede615930a567f40c9a9687d41c95b350498308e9f
3 | size 67086811
4 |
--------------------------------------------------------------------------------
/data/berlin_net/gtfs/BVG_VBB_bereichsscharf_20200520.zip:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:49f11002d4b97ec9a6539a633afa04af0887a67c401afebd6c6917fbeafec076
3 | size 62080838
4 |
--------------------------------------------------------------------------------
/data/berlin_net/gtfs/UMBW_Haltestellen_20200520.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/gtfs/UMBW_Haltestellen_20200520.zip
--------------------------------------------------------------------------------
/data/berlin_net/gtfs/berlin.cfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/data/berlin_net/gtfs/readme.txt:
--------------------------------------------------------------------------------
1 | GTFS-Fahrplandaten für den Bereich des Verkehrsverbunds Berlin Brandenburg VBB.
2 | Bezogen von https://www.vbb.de/unsere-themen/vbbdigital/api-entwicklerinfos/datensaetze
3 | Lizenz: CC-BY 4.0
4 |
--------------------------------------------------------------------------------
/data/berlin_net/landmarks:
--------------------------------------------------------------------------------
1 | -322481074#1
2 | -36918938#1
3 | -494874354#1
4 | -593503607#1
5 | 151329651
6 | 22720359#3
7 | 262949522
8 | 263828071#7
9 | 264314058
10 | 30194726
11 | 305117726
12 | 309124783
13 | 309842384#1
14 | 323108964
15 | 36918938#0
16 | 374934049#4
17 | 383652747
18 | 431727415
19 | 4446500
20 | 4543439
21 | 4686102#0
22 | 47016365#0
23 | 4804140#0
24 | 494874354#0
25 | 518427650
26 | 588046503
27 | 71231106#4
28 | 757729596
--------------------------------------------------------------------------------
/data/berlin_net/location_priorities.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/data/berlin_net/netpatch/patch.nod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/data/berlin_net/netpatch/patch_tram.con.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/data/berlin_net/netpatch/patch_tram.edg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/data/berlin_net/netpatch_pre/extra_edges.txt:
--------------------------------------------------------------------------------
1 | edge:139877315
2 | edge:139877316
3 | edge:139880221#0
4 | edge:139880221#1
5 | edge:139880222
6 | edge:198734779
7 | edge:393002725
8 | edge:448931475
9 | edge:450176846#0
10 | edge:450176846#1
11 | edge:450176847
12 | edge:56456752
13 | edge:56459641
14 | edge:56554320
15 | edge:-27062990
16 | edge:-309945650
17 | edge:106430527
18 | edge:106430529
19 | edge:108984475
20 | edge:108984481#0
21 | edge:108984481#1
22 | edge:108984481#10
23 | edge:108984481#11
24 | edge:108984481#12
25 | edge:108984481#13
26 | edge:108984481#14
27 | edge:108984481#15
28 | edge:108984481#16
29 | edge:108984481#2
30 | edge:108984481#3
31 | edge:108984481#4
32 | edge:108984481#5
33 | edge:108984481#6
34 | edge:108984481#7
35 | edge:108984481#8
36 | edge:108984481#9
37 | edge:14495473#0
38 | edge:14495473#1
39 | edge:14495473#2
40 | edge:14495473#3
41 | edge:14495473#4
42 | edge:14495473#5
43 | edge:14495473#6
44 | edge:14495473#7
45 | edge:14495504
46 | edge:14495692#0
47 | edge:14495692#1
48 | edge:14495692#2
49 | edge:14495692#3
50 | edge:14495692#4
51 | edge:14495692#5
52 | edge:236726668#0
53 | edge:236726668#1
54 | edge:27062990
55 | edge:27063147
56 | edge:309945650
57 | edge:331749733
58 | edge:340470165#0
59 | edge:340470165#1
60 | edge:395492723#0
61 | edge:395492723#1
62 | edge:55964707#0
63 | edge:55964707#1
64 | edge:715660360
65 | edge:715660361#0
66 | edge:715660361#1
67 | edge:715660361#2
68 | edge:715660361#3
69 | edge:715660361#4
70 | edge:715660361#5
71 |
72 |
--------------------------------------------------------------------------------
/data/berlin_net/netpatch_pre/keep_landmark.txt:
--------------------------------------------------------------------------------
1 | edge:-322481074#1
2 | egde:-36918938#1
3 | egde:-494874354#1
4 | egde:-593503607#1
5 | egde:151329651
6 | egde:22720359#3
7 | egde:262949522
8 | egde:263828071#7
9 | egde:264314058
10 | egde:30194726
11 | egde:305117726
12 | egde:309124783
13 | egde:309842384#1
14 | egde:323108964
15 | egde:36918938#0
16 | egde:374934049#4
17 | egde:383652747
18 | egde:431727415
19 | egde:4446500
20 | egde:4543439
21 | egde:4686102#0
22 | egde:47016365#0
23 | egde:4804140#0
24 | egde:494874354#0
25 | egde:518427650
26 | egde:588046503
27 | egde:71231106#4
28 | egde:757729596
--------------------------------------------------------------------------------
/data/berlin_net/osm/berlin_net.osm.xml.gz:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:64a7ff0f26980f0442510a6a0876a0a55dbf1e5fce071a2fc7eef9250089c11b
3 | size 129278623
4 |
--------------------------------------------------------------------------------
/data/berlin_net/ptVtypes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.ctf:
--------------------------------------------------------------------------------
1 | Name;Alias
2 | NO;NO
3 | CODE;CODE
4 | NAME;NAME
5 | TYPENO;TYPENO
6 | NUMLINES;NUMLINES
7 | NUMSERVICETRIPS(AP);NUMSERVI~1
8 |
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.dbf
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.prj:
--------------------------------------------------------------------------------
1 | PROJCS["DHDN_3_Degree_Gauss_Zone_4_TOWGS",GEOGCS["GCS_Deutsche_Hauptdreiecksnetz",DATUM["D_Deutsche_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128],TOWGS84[598.1,73.7,418.2,0.202,0.045,-2.455,0.0000067]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",4500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",12.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shp
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin Verkehrsbezirke (1193 VBz) GK4_zone.shx
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin_1223.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin_1223.dbf
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin_1223.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin_1223.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin_1223.shp
--------------------------------------------------------------------------------
/data/berlin_net/shapes/Berlin_1223.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/Berlin_1223.shx
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.cpg:
--------------------------------------------------------------------------------
1 | UTF-8
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.dbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/RBS_OD_ORT_1412.dbf
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.prj:
--------------------------------------------------------------------------------
1 | PROJCS["ETRS_1989_UTM_Zone_33N",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.sbn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/RBS_OD_ORT_1412.sbn
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.sbx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/RBS_OD_ORT_1412.sbx
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/RBS_OD_ORT_1412.shp
--------------------------------------------------------------------------------
/data/berlin_net/shapes/RBS_OD_ORT_1412.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/berlin_net/shapes/RBS_OD_ORT_1412.shx
--------------------------------------------------------------------------------
/data/berlin_net/template_gen0pt.netccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/data/berlin_net/template_gen1.netccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/data/jsprit/Ladezonen_100m_Duplicates_Filtered_by_BuildingBlocks.csv.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/jsprit/Ladezonen_100m_Duplicates_Filtered_by_BuildingBlocks.csv.gz
--------------------------------------------------------------------------------
/data/jsprit/beschreibung_der_Spaltenparameter (tourLegs).txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/jsprit/beschreibung_der_Spaltenparameter (tourLegs).txt
--------------------------------------------------------------------------------
/data/jsprit/tourLegsCharacteristics_UTM.csv.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/jsprit/tourLegsCharacteristics_UTM.csv.gz
--------------------------------------------------------------------------------
/data/mitte_net/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | @file __init__.py
3 | @author Michael.Behrisch@dlr.de
4 | @date 2015-06-10
5 | @version $Id: analysis.py 2493 2013-04-02 10:32:37Z behr_mi $
6 |
7 | custom script collection for mitte_2010
8 |
9 | Copyright (C) 2015-2017 DLR/TS, Germany
10 | All rights reserved
11 | """
12 | import os
13 |
14 | import assign
15 | import postprocess
16 | from sumolib.miscutils import benchmark
17 |
18 | def assign_trips(options, first_depart, last_depart, routes, weights):
19 | routes, weights = assign.run_oneshot(options, first_depart, last_depart, routes, weights)
20 | return assign.run_subnet(options, first_depart, last_depart, routes, weights, os.path.join(os.path.dirname(__file__), 'mitte.net.xml'))
21 |
22 | @benchmark
23 | def post(options, params, conn, routefile):
24 | postprocess.run_trajectory_sumo(options, os.path.join(os.path.dirname(options.net_file), 'mitte.net.xml'), routefile)
25 |
--------------------------------------------------------------------------------
/data/mitte_net/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | from __future__ import print_function
3 | import os, sys, shutil, subprocess, glob
4 | sys.path += [os.path.join(os.environ["SUMO_HOME"], 'tools')]
5 | import sumolib
6 |
7 | here = sys.argv[2]
8 | templates = os.path.dirname(here)
9 | prefix = os.path.join(here, "mitte")
10 | boundary = "13.374361,52.506304,13.474692,52.530199"
11 | output_net = prefix + ".net.xml"
12 |
13 | copies = ["berlin_net/vtypes.xml", "berlin_net/net.net.xml.gz",
14 | "berlin_net/landmarks.csv.gz", "berlin_net/*.taz.xml.gz"]
15 |
16 | # copy selected files from berlin scenario
17 | for source in copies:
18 | for sourcePath in glob.glob(os.path.join(templates, source)):
19 | if os.path.exists(sourcePath):
20 | print("copying %s" % os.path.basename(sourcePath))
21 | shutil.copyfile(sourcePath, os.path.join(here, os.path.basename(sourcePath)))
22 | else:
23 | print("skipping non existent %s" % source)
24 |
25 | # generate the new net based on the boundaries
26 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(here, "net.net.xml.gz"),
27 | "--keep-edges.in-geo-boundary", boundary, "--no-internal-links", "false",
28 | "--crossings.guess", "-o", output_net])
29 |
30 | # filter the relevant information from the copied files
31 | edges = set()
32 | with open(prefix + ".txt", "w") as edge_out:
33 | for edge in sumolib.output.parse_fast(output_net, 'edge', ['id']):
34 | if edge.id[0] != ':':
35 | edge_out.write(edge.id + "\n")
36 | edges.add(edge.id)
37 |
38 | with open(prefix + '_bidi.taz.xml', 'w') as bidi:
39 | bidi.write('\n')
40 | for taz in sumolib.output.parse(os.path.join(here, 'bidi.taz.xml.gz'), 'taz'):
41 | if taz.id in edges:
42 | taz.edges = " ".join([e for e in taz.edges.split() if e in edges])
43 | bidi.write(taz.toXML(" "))
44 | bidi.write('\n')
45 |
46 | with open(prefix + '_vtypes.xml', 'w') as vtypeOut:
47 | vtypeOut.write('\n')
48 | for vType in sumolib.output.parse(os.path.join(here, 'vtypes.xml'), 'vType'):
49 | vType.speedDev = 0.1
50 | vtypeOut.write(vType.toXML(" "))
51 | vtypeOut.write('\n')
52 |
--------------------------------------------------------------------------------
/data/mitte_test/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | @file __init__.py
3 | @author Michael.Behrisch@dlr.de
4 | @date 2015-06-10
5 | @version $Id: __init__.py 8298 2020-03-05 12:31:51Z behr_mi $
6 |
7 | custom script collection for berlin_2010
8 |
9 | Copyright (C) 2015-2015 DLR/TS, Germany
10 | All rights reserved
11 | """
12 | import subprocess
13 | import assign
14 | import postprocess
15 | from sumolib.miscutils import benchmark
16 |
17 | assign_trips = assign.run_default
18 |
19 | @benchmark
20 | def post(options, params, conn, routefile):
21 | procs = [postprocess.run_pedestrian_sumo(options, routefile),
22 | postprocess.run_emission_sumo(options, params, conn, routefile)]
23 | err = None
24 | for p in procs:
25 | if p is not None:
26 | retcode = p[1].wait()
27 | if retcode:
28 | err = subprocess.CalledProcessError(retcode, p[0])
29 | if err:
30 | raise err
31 |
--------------------------------------------------------------------------------
/data/mitte_test/gtfs:
--------------------------------------------------------------------------------
1 | $TSC_HOME/data/berlin_net/gtfs
--------------------------------------------------------------------------------
/data/mitte_test/landmarks:
--------------------------------------------------------------------------------
1 | 47016365#0
2 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch.con.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch.edg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch.nod.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch.tll.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch_tram.con.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch/patch_tram.edg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch_pre/extra_edges.txt:
--------------------------------------------------------------------------------
1 | edge:139877315
2 | edge:139877316
3 | edge:139880221#0
4 | edge:139880221#1
5 | edge:139880222
6 | edge:198734779
7 | edge:393002725
8 | edge:448931475
9 | edge:450176846#0
10 | edge:450176846#1
11 | edge:450176847
12 | edge:56456752
13 | edge:56459641
14 | edge:56554320
15 | edge:-27062990
16 | edge:-309945650
17 | edge:106430527
18 | edge:106430529
19 | edge:108984475
20 | edge:108984481#0
21 | edge:108984481#1
22 | edge:108984481#10
23 | edge:108984481#11
24 | edge:108984481#12
25 | edge:108984481#13
26 | edge:108984481#14
27 | edge:108984481#15
28 | edge:108984481#16
29 | edge:108984481#2
30 | edge:108984481#3
31 | edge:108984481#4
32 | edge:108984481#5
33 | edge:108984481#6
34 | edge:108984481#7
35 | edge:108984481#8
36 | edge:108984481#9
37 | edge:14495473#0
38 | edge:14495473#1
39 | edge:14495473#2
40 | edge:14495473#3
41 | edge:14495473#4
42 | edge:14495473#5
43 | edge:14495473#6
44 | edge:14495473#7
45 | edge:14495504
46 | edge:14495692#0
47 | edge:14495692#1
48 | edge:14495692#2
49 | edge:14495692#3
50 | edge:14495692#4
51 | edge:14495692#5
52 | edge:236726668#0
53 | edge:236726668#1
54 | edge:27062990
55 | edge:27063147
56 | edge:309945650
57 | edge:331749733
58 | edge:340470165#0
59 | edge:340470165#1
60 | edge:395492723#0
61 | edge:395492723#1
62 | edge:55964707#0
63 | edge:55964707#1
64 | edge:715660360
65 | edge:715660361#0
66 | edge:715660361#1
67 | edge:715660361#2
68 | edge:715660361#3
69 | edge:715660361#4
70 | edge:715660361#5
71 |
72 |
--------------------------------------------------------------------------------
/data/mitte_test/netpatch_pre/keep_landmark.txt:
--------------------------------------------------------------------------------
1 | edge:-322481074#1
2 | egde:-36918938#1
3 | egde:-494874354#1
4 | egde:-593503607#1
5 | egde:151329651
6 | egde:22720359#3
7 | egde:262949522
8 | egde:263828071#7
9 | egde:264314058
10 | egde:30194726
11 | egde:305117726
12 | egde:309124783
13 | egde:309842384#1
14 | egde:323108964
15 | egde:36918938#0
16 | egde:374934049#4
17 | egde:383652747
18 | egde:431727415
19 | egde:4446500
20 | egde:4543439
21 | egde:4686102#0
22 | egde:47016365#0
23 | egde:4804140#0
24 | egde:494874354#0
25 | egde:518427650
26 | egde:588046503
27 | egde:71231106#4
28 | egde:757729596
--------------------------------------------------------------------------------
/data/mitte_test/osm/osm_bbox.osm.xml.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/data/mitte_test/osm/osm_bbox.osm.xml.gz
--------------------------------------------------------------------------------
/data/mitte_test/ptVtypes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/data/mitte_test/shapes:
--------------------------------------------------------------------------------
1 | $TSC_HOME/data/berlin_net/shapes
--------------------------------------------------------------------------------
/data/mitte_test/template_gen0.netccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/data/mitte_test/template_gen1.netccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/data/move_urban/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | @file __init__.py
3 | @author Michael.Behrisch@dlr.de
4 | @date 2015-06-10
5 | @version $Id: analysis.py 2493 2013-04-02 10:32:37Z behr_mi $
6 |
7 | custom script collection for move_urban
8 |
9 | Copyright (C) 2015-2017 DLR/TS, Germany
10 | All rights reserved
11 | """
12 | import os
13 |
14 | import assign
15 |
16 | def assign_trips(options, first_depart, last_depart, routes, weights):
17 | routes, weights = assign.run_oneshot(options, first_depart, last_depart, routes, weights)
18 | return assign.run_subnet(options, first_depart, last_depart, routes, weights, os.path.join(os.path.dirname(__file__), 'spandau.net.xml'))
19 |
--------------------------------------------------------------------------------
/data/move_urban/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | from __future__ import print_function
3 | import os, sys, shutil, subprocess, glob
4 | sys.path += [os.path.join(os.environ["SUMO_HOME"], 'tools')]
5 | import sumolib
6 |
7 | here = sys.argv[2]
8 | templates = os.path.dirname(here)
9 | prefix = os.path.join(here, "spandau")
10 | boundary = "13.1907,52.529,13.3053,52.566"
11 | output_net = prefix + ".net.xml"
12 |
13 | copies = ["berlin_net/vtypes.xml", "berlin_net/net.net.xml.gz",
14 | "berlin_net/landmarks.csv.gz", "berlin_net/*.taz.xml.gz",
15 | "berlin_net/pt*.xml.gz"]
16 |
17 | # copy selected files from berlin scenario
18 | for source in copies:
19 | for sourcePath in glob.glob(os.path.join(templates, source)):
20 | if os.path.exists(sourcePath):
21 | sourceFile = os.path.basename(sourcePath)
22 | print("copying %s" % sourceFile)
23 | shutil.copyfile(sourcePath, os.path.join(here, sourceFile))
24 | else:
25 | print("skipping non existent %s" % sourceFile)
26 |
27 | with open(os.path.join(here, 'vtypes.xml'), 'w') as vtypeOut:
28 | sumolib.xml.writeHeader(vtypeOut, root="additional")
29 | for vType in sumolib.xml.parse(os.path.join(templates, 'berlin_net', 'vtypes.xml'), 'vType'):
30 | vtypeOut.write(vType.toXML(" "))
31 | vType.id += "_automated"
32 | vtypeOut.write(vType.toXML(" "))
33 | vtypeOut.write('\n')
34 |
35 | # generate the new net based on the boundaries
36 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(here, "net.net.xml.gz"),
37 | "--keep-edges.in-geo-boundary", boundary, "--no-internal-links", "false",
38 | "--crossings.guess", "-o", output_net])
39 |
40 | # generate the buslane nets
41 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(here, "net.net.xml.gz"),
42 | "--edge-files", os.path.join(here, "busspur.edg.xml"),
43 | "--connection-files", os.path.join(here, "busspur.con.xml"),
44 | "--tllogic-files", os.path.join(here, "busspur.tll.xml"),
45 | "-o", os.path.join(here, "busspur.net.xml.gz")])
46 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(here, "busspur.net.xml.gz"),
47 | "--keep-edges.in-geo-boundary", boundary, "--no-internal-links", "false",
48 | "--crossings.guess", "-o", prefix + "_busspur.net.xml"])
49 |
50 | # filter the relevant information from the copied files
51 | edges = set()
52 | with open(prefix + ".txt", "w") as edge_out:
53 | for edge in sumolib.xml.parse_fast(output_net, 'edge', ['id']):
54 | if edge.id[0] != ':':
55 | edge_out.write(edge.id + "\n")
56 | edges.add(edge.id)
57 |
58 | with open(prefix + '_bidi.taz.xml', 'w') as bidi:
59 | bidi.write('\n')
60 | for taz in sumolib.xml.parse(os.path.join(here, 'bidi.taz.xml.gz'), 'taz'):
61 | if taz.id in edges:
62 | taz.edges = " ".join([e for e in taz.edges.split() if e in edges])
63 | bidi.write(taz.toXML(" "))
64 | bidi.write('\n')
65 |
66 | with open(prefix + '_vtypes.xml', 'w') as vtypeOut:
67 | sumolib.xml.writeHeader(vtypeOut, root="additional")
68 | for vType in sumolib.xml.parse(os.path.join(here, 'vtypes.xml'), 'vType'):
69 | vType.speedDev = 0.1
70 | vtypeOut.write(vType.toXML(" "))
71 | vtypeOut.write('\n')
72 |
--------------------------------------------------------------------------------
/data/siemensbahn/landmarks:
--------------------------------------------------------------------------------
1 | -322481074#1
2 | -36918938#1
3 | -494874354#1
4 | -593503607#1
5 | 151329651
6 | 22720359#3
7 | 262949522
8 | 263828071#7
9 | 264314058
10 | 30194726
11 | 305117726
12 | 309124783
13 | 309842384#1
14 | 323108964
15 | 36918938#0
16 | 374934049#4
17 | 383652747
18 | 431727415
19 | 4446500
20 | 4543439
21 | 4686102#0
22 | 47016365#0
23 | 4804140#0
24 | 494874354#0
25 | 518427650
26 | 588046503
27 | 71231106#4
28 | 757729596
--------------------------------------------------------------------------------
/data/siemensbahn/pt_siemensbahn_vehicles.add.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/data/siemensbahn/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | from __future__ import print_function
3 | import os, sys, shutil, subprocess, glob
4 | sys.path += [os.path.join(os.environ["SUMO_HOME"], 'tools')]
5 | import sumolib
6 |
7 | here = sys.argv[2]
8 | templates = os.path.dirname(here)
9 | prefix = os.path.join(here, "spandau")
10 | boundary = "13.1907,52.529,13.3053,52.566"
11 | output_net = prefix + ".net.xml"
12 |
13 | copies = ["move_urban/vtypes.xml", "move_urban/*.taz.xml.gz",
14 | "move_urban/pt*.xml.gz"]
15 |
16 | # copy selected files from berlin scenario
17 | for source in copies:
18 | for sourcePath in glob.glob(os.path.join(templates, source)):
19 | if os.path.exists(sourcePath):
20 | sourceFile = os.path.basename(sourcePath)
21 | print("copying %s" % sourceFile)
22 | shutil.copyfile(sourcePath, os.path.join(here, sourceFile))
23 | else:
24 | print("skipping non existent %s" % sourceFile)
25 |
26 | # generate the new net including siemensbahn
27 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(templates, "berlin_net", "net.net.xml.gz"),
28 | "-n", os.path.join(here, "siemensbahn.nod.xml"), "-e", os.path.join(here, "siemensbahn.edg.xml"),
29 | "-o", os.path.join(here, "net.net.xml.gz")])
30 |
31 | # generate the new subnet based on the boundaries
32 | subprocess.call([sumolib.checkBinary("netconvert"), "-s", os.path.join(here, "net.net.xml.gz"),
33 | "--keep-edges.in-geo-boundary", boundary, "--no-internal-links", "false",
34 | "--crossings.guess", "-o", output_net])
35 |
36 | # filter the relevant information from the copied files
37 | edges = set()
38 | with open(prefix + ".txt", "w") as edge_out:
39 | for edge in sumolib.output.parse_fast(output_net, 'edge', ['id']):
40 | if edge.id[0] != ':':
41 | edge_out.write(edge.id + "\n")
42 | edges.add(edge.id)
43 |
44 | with open(prefix + '_bidi.taz.xml', 'w') as bidi:
45 | bidi.write('\n')
46 | for taz in sumolib.output.parse(os.path.join(here, 'bidi.taz.xml.gz'), 'taz'):
47 | if taz.id in edges:
48 | taz.edges = " ".join([e for e in taz.edges.split() if e in edges])
49 | bidi.write(taz.toXML(" "))
50 | bidi.write('\n')
51 |
52 | with open(prefix + '_vtypes.xml', 'w') as vtypeOut:
53 | vtypeOut.write('\n')
54 | for vType in sumolib.output.parse(os.path.join(here, 'vtypes.xml'), 'vType'):
55 | vType.speedDev = 0.1
56 | vtypeOut.write(vType.toXML(" "))
57 | vtypeOut.write('\n')
58 |
--------------------------------------------------------------------------------
/data/siemensbahn/siemensbahn.nod.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/docs/20210604LastenheftSUMO_TAPAS.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/docs/20210604LastenheftSUMO_TAPAS.docx
--------------------------------------------------------------------------------
/postgres_template.tsccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = [ "setuptools>=42" ]
3 | build-backend = "setuptools.build_meta"
4 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | rtree
2 | pyproj
3 | psycopg2
4 | pandas
5 |
--------------------------------------------------------------------------------
/setup.cfg:
--------------------------------------------------------------------------------
1 | [metadata]
2 | name = tapas-sumo-coupling
3 | version = 0.23.1
4 |
5 | [options]
6 | install_requires =
7 | rtree
8 | pyproj
9 | psycopg2
10 | pandas
11 | sumolib
12 |
13 | [options.entry_points]
14 | console_scripts =
15 | tsc_main = tapas_sumo_coupling:tsc_main.main
16 | tsc_install = tapas_sumo_coupling:install_scenario_templates.main
17 |
--------------------------------------------------------------------------------
/sqlite3.tsccfg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/tapas_sumo_coupling/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLR-TS/tsc/d5322413ea97e198f576b20f7de89877fe1572fd/src/tapas_sumo_coupling/__init__.py
--------------------------------------------------------------------------------
/src/tapas_sumo_coupling/__main__.py:
--------------------------------------------------------------------------------
1 | from tapas_sumo_coupling import tsc_main
2 |
3 | if __name__ == '__main__':
4 | tsc_main.main()
5 |
--------------------------------------------------------------------------------
/src/tapas_sumo_coupling/get_germany_taz.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # Copyright (C) 2013-2025 German Aerospace Center (DLR) and others.
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Eclipse Public License 2.0 which is available at
6 | # https://www.eclipse.org/legal/epl-2.0/
7 | # This Source Code may also be made available under the following Secondary
8 | # Licenses when the conditions for such availability set forth in the Eclipse
9 | # Public License 2.0 are satisfied: GNU General Public License, version 2
10 | # or later which is available at
11 | # https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 |
14 | # @file get_germany_taz.py
15 | # @author Jakob Erdmann
16 | # @author Michael Behrisch
17 | # @date 2013-12-15
18 |
19 | # pull taz for germany from the VF tapas server
20 |
21 | from __future__ import print_function
22 | import os
23 | import sys
24 | import ast
25 |
26 | sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools'))
27 | import sumolib # noqa
28 |
29 | from tapas_sumo_coupling import database # noqa
30 |
31 |
32 | def parse_args():
33 | argParser = sumolib.options.ArgumentParser()
34 | database.add_db_arguments(argParser)
35 | argParser.add_argument("-o", "--output", default="d-modell.poly.xml", help="output file")
36 | return argParser.parse_args()
37 |
38 |
39 | def get_polys(server_options, table='quesadillas.zonierung_d_modell', net=None):
40 | conn = database.get_conn(server_options)
41 | if conn is None:
42 | print("Warning! No database, cannot retrieve suburbian TAZ.")
43 | return
44 | if not database.table_exists(conn, table.split(".")[1], table.split(".")[0]):
45 | print("Warning! Table '%s' does not exist, cannot retrieve suburbian TAZ." % table)
46 | return
47 | command = "SELECT vbz_6561, ST_ASTEXT(ST_TRANSFORM(the_geom, 4326)) FROM %s" % table
48 | cursor = conn.cursor()
49 | cursor.execute(command)
50 | for row in cursor:
51 | tazid = int(row[0])
52 | if row[1].startswith("MULTIPOLYGON"):
53 | multi = ast.literal_eval(row[1][12:].replace(" ", ","))
54 | if type(multi[0]) is float:
55 | multi = (multi,)
56 | shapes = []
57 | for s in multi:
58 | if type(s[0]) is tuple:
59 | s = s[0]
60 | shape = []
61 | x = None
62 | for idx, coord in enumerate(s):
63 | if x is None:
64 | x = coord
65 | else:
66 | if net is not None:
67 | x, coord = net.convertLonLat2XY(x, coord)
68 | shape.append((x, coord))
69 | x = None
70 | shapes.append(shape)
71 | yield tazid, shapes
72 | else:
73 | print("unknown shape", row)
74 | conn.close()
75 |
76 | def main():
77 | options = parse_args()
78 | with open(options.output, "w") as out:
79 | for tazid, shapes in get_polys(options):
80 | for idx, shape in enumerate(shapes):
81 | print(' ' % (tazid, idx, " ".join(["%s,%s" % e for e in shape])), file=out)
82 |
83 |
84 | if __name__ == "__main__":
85 | main()
86 |
--------------------------------------------------------------------------------
/src/tapas_sumo_coupling/get_motorway_access.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # Copyright (C) 2013-2025 German Aerospace Center (DLR) and others.
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Eclipse Public License 2.0 which is available at
6 | # https://www.eclipse.org/legal/epl-2.0/
7 | # This Source Code may also be made available under the following Secondary
8 | # Licenses when the conditions for such availability set forth in the Eclipse
9 | # Public License 2.0 are satisfied: GNU General Public License, version 2
10 | # or later which is available at
11 | # https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 |
14 | # @file get_motorway_access.py
15 | # @author Jakob Erdmann
16 | # @author Michael Behrisch
17 | # @date 2013-12-15
18 |
19 | # create motorway access points for special locations
20 |
21 | from __future__ import print_function
22 | import os
23 | import sys
24 |
25 | if 'SUMO_HOME' in os.environ:
26 | sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools'))
27 | else:
28 | sys.exit("please declare environment variable 'SUMO_HOME'")
29 | from sumolib.options import ArgumentParser
30 |
31 | from tapas_sumo_coupling import database
32 |
33 |
34 | def parse_args():
35 | argParser = ArgumentParser()
36 | database.add_db_arguments(argParser)
37 | argParser.add_argument("-o", "--output", default="osm_scenario_pre/mitte_net/location_priorities.xml", help="output file")
38 | options = argParser.parse_args()
39 | return options
40 |
41 |
42 | def get_locations(server, table):
43 | conn = database.get_conn(server)
44 | for suffix in ("start", "end"):
45 | command = """SELECT DISTINCT taz_id_%s, lon_%s, lat_%s FROM core.%s
46 | WHERE taz_id_%s < -1000000""" % (suffix, suffix, suffix, table, suffix)
47 | cursor = conn.cursor()
48 | cursor.execute(command)
49 | for row in cursor:
50 | yield (row[0], suffix[0]) + row[1:]
51 | conn.close()
52 |
53 |
54 | def save_locations(output, server, table='berlin_grundlast_2010_ref'):
55 | with open(output, "w") as out:
56 | print("", file=out)
57 | for loc in sorted(get_locations(server, table)):
58 | print(' ' % loc, file=out)
59 | print("", file=out)
60 |
61 |
62 | if __name__ == "__main__":
63 | options = parse_args()
64 | save_locations(options.output, options)
65 |
--------------------------------------------------------------------------------
/tests/runSQLiteTests.bat:
--------------------------------------------------------------------------------
1 | call testEnv.bat %1
2 | %TEXTTESTPY% -a tsc.sqlite3
3 |
--------------------------------------------------------------------------------
/tests/runSQLiteTests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #Bash script for the test run.
3 | #sets environment variables and starts texttest
4 |
5 | pushd `dirname $0` > /dev/null
6 | shopt -s nullglob # expand the pattern to an empty list if no env exists
7 | for i in *env/bin/activate; do
8 | if test x"$VIRTUAL_ENV" = x; then
9 | echo "Activating virtual environment $(dirname $(dirname $i))."
10 | source $i
11 | else
12 | echo "Virtual environment $VIRTUAL_ENV already active, ignoring $(dirname $(dirname $i))."
13 | fi
14 | done
15 | popd > /dev/null
16 | if test x"$SUMO_HOME" = x; then
17 | export SUMO_HOME="$HOME/sumo"
18 | fi
19 | export ACTIVITYGEN_BINARY="$SUMO_HOME/bin/activitygen$SUFFIX"
20 | export DFROUTER_BINARY="$SUMO_HOME/bin/dfrouter$SUFFIX"
21 | export DUAROUTER_BINARY="$SUMO_HOME/bin/duarouter$SUFFIX"
22 | export JTRROUTER_BINARY="$SUMO_HOME/bin/jtrrouter$SUFFIX"
23 | export MAROUTER_BINARY="$SUMO_HOME/bin/marouter$SUFFIX"
24 | export NETCONVERT_BINARY="$SUMO_HOME/bin/netconvert$SUFFIX"
25 | export NETEDIT_BINARY="$SUMO_HOME/bin/netedit$SUFFIX"
26 | export NETGENERATE_BINARY="$SUMO_HOME/bin/netgenerate$SUFFIX"
27 | export OD2TRIPS_BINARY="$SUMO_HOME/bin/od2trips$SUFFIX"
28 | export POLYCONVERT_BINARY="$SUMO_HOME/bin/polyconvert$SUFFIX"
29 | export SUMO_BINARY="$SUMO_HOME/bin/sumo$SUFFIX"
30 | export GUISIM_BINARY="$SUMO_HOME/bin/sumo-gui$SUFFIX"
31 | export TSC_HOME=$(dirname $(dirname $(realpath $0)))
32 | export TEXTTEST_HOME="$TSC_HOME/tests"
33 | export PYTHON=python3
34 | export LANG=C
35 |
36 | texttest -a tsc.sqlite3.python3
37 |
--------------------------------------------------------------------------------
/tests/runTests.bat:
--------------------------------------------------------------------------------
1 | call testEnv.bat %1
2 | %TEXTTESTPY%
3 |
--------------------------------------------------------------------------------
/tests/runTests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Bash script for the test run.
3 | # Sets environment variables, activates a possible virtualenv, and starts texttest.
4 |
5 | pushd `dirname $0` > /dev/null
6 | shopt -s nullglob # expand the pattern to an empty list if no env exists
7 | for i in *env/bin/activate; do
8 | if test x"$VIRTUAL_ENV" = x; then
9 | echo "Activating virtual environment $(dirname $(dirname $i))."
10 | source $i
11 | else
12 | echo "Virtual environment $VIRTUAL_ENV already active, ignoring $(dirname $(dirname $i))."
13 | fi
14 | done
15 | popd > /dev/null
16 | if test x"$SUMO_HOME" = x; then
17 | export SUMO_HOME="$HOME/sumo"
18 | fi
19 | export ACTIVITYGEN_BINARY="$SUMO_HOME/bin/activitygen$SUFFIX"
20 | export DFROUTER_BINARY="$SUMO_HOME/bin/dfrouter$SUFFIX"
21 | export DUAROUTER_BINARY="$SUMO_HOME/bin/duarouter$SUFFIX"
22 | export JTRROUTER_BINARY="$SUMO_HOME/bin/jtrrouter$SUFFIX"
23 | export MAROUTER_BINARY="$SUMO_HOME/bin/marouter$SUFFIX"
24 | export NETCONVERT_BINARY="$SUMO_HOME/bin/netconvert$SUFFIX"
25 | export NETEDIT_BINARY="$SUMO_HOME/bin/netedit$SUFFIX"
26 | export NETGENERATE_BINARY="$SUMO_HOME/bin/netgenerate$SUFFIX"
27 | export OD2TRIPS_BINARY="$SUMO_HOME/bin/od2trips$SUFFIX"
28 | export POLYCONVERT_BINARY="$SUMO_HOME/bin/polyconvert$SUFFIX"
29 | export SUMO_BINARY="$SUMO_HOME/bin/sumo$SUFFIX"
30 | export GUISIM_BINARY="$SUMO_HOME/bin/sumo-gui$SUFFIX"
31 | export TSC_HOME=$(dirname $(dirname $(realpath $0)))
32 | export TEXTTEST_HOME="$TSC_HOME/tests"
33 |
34 | if which texttest &> /dev/null; then
35 | texttest "$@"
36 | else
37 | texttest.py "$@"
38 | fi
39 |
--------------------------------------------------------------------------------
/tests/testEnv.bat:
--------------------------------------------------------------------------------
1 | set TEXTTEST_HOME=%CD%
2 | set ACTIVITYGEN_BINARY=%SUMO_HOME%\bin\activitygen%1.exe
3 | set DFROUTER_BINARY=%SUMO_HOME%\bin\dfrouter%1.exe
4 | set DUAROUTER_BINARY=%SUMO_HOME%\bin\duarouter%1.exe
5 | set JTRROUTER_BINARY=%SUMO_HOME%\bin\jtrrouter%1.exe
6 | set NETCONVERT_BINARY=%SUMO_HOME%\bin\netconvert%1.exe
7 | set NETEDIT_BINARY=%SUMO_HOME%\bin\netedit%1.exe
8 | set NETGENERATE_BINARY=%SUMO_HOME%\bin\netgenerate%1.exe
9 | set OD2TRIPS_BINARY=%SUMO_HOME%\bin\od2trips%1.exe
10 | set SUMO_BINARY=%SUMO_HOME%\bin\sumo%1.exe
11 | set POLYCONVERT_BINARY=%SUMO_HOME%\bin\polyconvert%1.exe
12 | set GUISIM_BINARY=%SUMO_HOME%\bin\sumo-gui%1.exe
13 | set MAROUTER_BINARY=%SUMO_HOME%\bin\marouter%1.exe
14 | set EMISSIONSDRIVINGCYCLE_BINARY=%SUMO_HOME%\bin\emissionsDrivingCycle%1.exe
15 | set EMISSIONSMAP_BINARY=%SUMO_HOME%\bin\emissionsMap%1.exe
16 | set PYTHON=python
17 | set TSC_HOME=%CD%\..
18 |
19 | SET TEXTTESTPY=texttest.py
20 | python -c "import texttestlib"
21 | IF NOT ERRORLEVEL 1 SET TEXTTESTPY=texttest.pyw
22 | where.exe texttest.exe > NUL 2> NUL
23 | IF NOT ERRORLEVEL 1 SET TEXTTESTPY=texttest.exe
24 |
--------------------------------------------------------------------------------
/tests/tsc/config.tsc:
--------------------------------------------------------------------------------
1 | home_operating_system:posix
2 | batch_result_repository:$SCENARIO_BATCH_RESULT
3 | historical_report_location:$SCENARIO_REPORT
4 | kill_timeout:3600
5 | binary:runner.py
6 | config_module:default
7 | create_catalogues:true
8 |
9 | copy_test_path_merge:data
10 | copy_test_path:tscdefs.py
11 | copy_test_path:runner.py
12 | copy_test_path:template_gen.netccfg
13 |
14 | [collate_file]
15 | log:log.txt
16 | rectifiedTrips:data/scenario_workdir/*/iteration000/trips/rectified*.csv
17 | resultingTripFile:data/scenario_workdir/*/*/trips/2*ms.csv
18 | resultingAllPairsFile:data/scenario_workdir/*/*/trips/all_pairs*.csv
19 | sumoTrips:data/scenario_workdir/*/iteration000/trips/miv*.trips.xml
20 | stacktrace:{CLEAR LIST}
21 |
22 | [run_dependent_text]
23 | output:\r{REPLACE \n}
24 | output:(\\)+{REPLACE /}
25 | output:[0-9\.]+ms{REPLACE (TIME)}
26 | output:^Performance:{->}^Vehicles:
27 | output:^using.*bin/sumo
28 | output:^function .* finished after .* seconds
29 | output:^function .* called at .*
30 | output:Begin time:
31 | output:End time:
32 | output:Duration:
33 | output:ended (duration:
34 | output:answered .* queries and explored
35 | output:{INTERNAL writedir}{REPLACE }
36 | output:([A-Z]:)?/.*/bin/netconvert(.exe)?{REPLACE netconvert}
37 | output:([A-Z]:)?/.*/bin/polyconvert(.exe)?{REPLACE polyconvert}
38 | output:([A-Z]:)?/.*/bin/duarouter(.exe)?{REPLACE duarouter}
39 | output:([A-Z]:)?/.*/osm_scenario_pre{REPLACE }
40 | output:Simulation.*started with{REPLACE Simulation started with}
41 | output:Parsing types from '.*/{REPLACE Parsing types from osm/typemap}
42 | output:Written configuration to '.*/{REPLACE Written configuration to '}
43 | output:AStarRouter spent .*
44 | output:DijkstraRouter spent .*
45 | output:parsing .*tsccfg{REPLACE parsing }
46 | output:No module named scripts{REPLACE No module named 'scripts'}
47 | output:starting main.*{REPLACE starting main }
48 | output:/[a-z_/]*/data/mitte_test/{REPLACE data/mitte_test/}
49 | output:/[a-z_/]*/data/berlin_net/{REPLACE data/berlin_net/}
50 | errors:Exception AttributeError: AttributeError("'NoneType' object has no attribute 'Error_GetErrorCount'",) in tests in