Skip to content

Commit

Permalink
Merge pull request #122 from matsim-scenarios/6.x
Browse files Browse the repository at this point in the history
6.1 Release
  • Loading branch information
rakow authored Apr 17, 2024
2 parents 28e97bf + f5f599c commit 4ba494f
Show file tree
Hide file tree
Showing 114 changed files with 4,925 additions and 2,256 deletions.
117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

20 changes: 18 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.


### 6.1 (2024-04-17)

- Trips from survey data are filtered slightly different
- Previously, trips that did not have the flag `E_WEG_GUELTIG`, have been ignored.
- However, this flag is not considered in SrV reports, or the Berlin website that reports the modal share.
- To be more consistent with these reports, these trips are now considered as well.
- This leads to slightly different mode shares compared to the previous version.

- Commercial traffic was updated to include recent changes
- Temporal distribution was updated according to survey data
- Separated car and freight/truck mode

### 6.0 (2024-02-20)

Initial release of the updated MATSim Open Berlin scenario.
For more information, see the paper (tba.)
106 changes: 45 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


JAR := matsim-berlin-*.jar
V := v6.0
V := v6.1
CRS := EPSG:25832

p := input/$V
Expand Down Expand Up @@ -52,6 +52,7 @@ input/PLR_2013_2020.csv:
rm atlas.zip

$(berlin)/input/shp/Planungsraum_EPSG_25833.shp:
# This link is broken, the file is available in the public svn
curl https://www.stadtentwicklung.berlin.de/planen/basisdaten_stadtentwicklung/lor/download/LOR_SHP_EPSG_25833.zip -o tmp.zip
unzip tmp.zip -d $(berlin)/input
rm tmp.zip
Expand Down Expand Up @@ -91,25 +92,35 @@ input/sumo.net.xml: input/network.osm
--osm-files $< -o=$@


$p/berlin-v6.0-network.xml.gz:
$p/berlin-v6.1-network.xml.gz:
# Use 5.x network
$(sc) prepare reproject-network\
--input $(berlin)/../berlin-v5.5-10pct/input/berlin-v5.5-network.xml.gz\
--transit-schedule $(berlin)/../berlin-v5.5-10pct/input/berlin-v5.5-transit-schedule.xml.gz\
--output $@\
--output-transit $p/berlin-v6.0-transitSchedule.xml.gz\
--output-transit $p/berlin-v6.1-transitSchedule.xml.gz\
--input-crs EPSG:31468\
--mode freight=truck\
--target-crs $(CRS)

# Apply v5 fixes
$(sc) prepare fix-network-v5 --input $@ --output $@

$p/berlin-v6.0-network-with-pt.xml.gz: $p/berlin-v6.0-network.xml.gz

$p/berlin-v6.1-network-with-pt.xml.gz: $p/berlin-v6.1-network.xml.gz
# Copy 5.x network stuff
cp $< $@
cp $(berlin)/../berlin-v5.5-10pct/input/berlin-v5.5-transit-vehicles.xml.gz $p/berlin-v6.0-transitVehicles.xml.gz

cp $(berlin)/../berlin-v5.5-10pct/input/berlin-v5.5-transit-vehicles.xml.gz $p/berlin-v6.1-transitVehicles.xml.gz

$p/berlin-v6.1-counts-vmz.xml.gz:
$(sc) prepare counts-from-vmz-old\
--csv ../shared-svn/projects/matsim-berlin/berlin-v5.5/original_data/vmz_counts_2018/CountsId_to_linkId_v2.csv\
--excel ../shared-svn/projects/matsim-berlin/berlin-v5.5/original_data/vmz_counts_2018/Datenexport_2018_TU_Berlin.xlsx\
--output $@

# TODO: Not part of 6.0 release, but planned for future versions
$p/berlin-v6.1-network.xml.gz: input/sumo.net.xml
$p/berlin-v6.2-network.xml.gz: input/sumo.net.xml
$(sc) prepare network-from-sumo $< --target-crs $(CRS) --output $@

$(sc) prepare clean-network $@ --output $@ --modes car
Expand All @@ -121,29 +132,23 @@ $p/berlin-v6.1-network.xml.gz: input/sumo.net.xml

$(sc) prepare network-freespeed --network $@ --params input/network-params.json --output $@

$p/berlin-v6.1-network-with-pt.xml.gz: $p/berlin-v6.1-network.xml.gz
$p/berlin-v6.2-network-with-pt.xml.gz: $p/berlin-v6.2-network.xml.gz
$(sc) prepare transit-from-gtfs --network $< --output=$p\
--name berlin-$V --date "2023-06-07" --target-crs $(CRS) \
$(germany)/gtfs/complete-pt-2023-06-06.zip\
--shp $p/pt-area/pt-area.shp

$p/berlin-v6.1-counts-car-vmz.xml.gz: $p/berlin-v6.1-network.xml.gz
$p/berlin-v6.2-counts-vmz.xml.gz: $p/berlin-v6.1-network.xml.gz
$(sc) prepare counts-from-vmz\
--excel ../shared-svn/projects/matsim-berlin/berlin-v5.5/original_data/vmz_counts_2018/Datenexport_2018_TU_Berlin.xlsx\
--network $<\
--network-geometries $p/berlin-v6.0-network-linkGeometries.csv\
--network-geometries $p/berlin-v6.2-network-linkGeometries.csv\
--output $p/\
--version berlin-$(V)\
--input-crs EPSG:31468\
--target-crs $(CRS)\
--ignored-counts input/ignored_counts.csv

input/v6.0/berlin-v6.0-counts-car-vmz.xml.gz:
$(sc) prepare counts-from-vmz-old\
--csv ../shared-svn/projects/matsim-berlin/berlin-v5.5/original_data/vmz_counts_2018/CountsId_to_linkId.csv\
--excel ../shared-svn/projects/matsim-berlin/berlin-v5.5/original_data/vmz_counts_2018/Datenexport_2018_TU_Berlin.xlsx\
--output $@

$p/berlin-$V-facilities.xml.gz: $p/berlin-$V-network.xml.gz input/facilities.shp
$(sc) prepare facilities --network $< --shp $(word 2,$^)\
--output $@
Expand All @@ -156,15 +161,15 @@ $p/berlin-only-$V-25pct.plans.xml.gz: input/PLR_2013_2020.csv $(berlin)/input/sh
--output $@


$p/brandeburg-only-$V-25pct.plans.xml.gz: input/landuse.shp
$p/brandenburg-only-$V-25pct.plans.xml.gz: input/landuse.shp
$(sc) prepare brandenburg-population\
--shp $(germany)/vg5000/vg5000_ebenen_0101/VG5000_GEM.shp\
--population $(germany)/regionalstatistik/population.csv\
--employees $(germany)/regionalstatistik/employed.json\
--landuse $< --landuse-filter residential\
--output $@

$p/berlin-static-$V-25pct.plans.xml.gz: $p/berlin-only-$V-25pct.plans.xml.gz $p/brandeburg-only-$V-25pct.plans.xml.gz
$p/berlin-static-$V-25pct.plans.xml.gz: $p/berlin-only-$V-25pct.plans.xml.gz $p/brandenburg-only-$V-25pct.plans.xml.gz
$(sc) prepare merge-populations $^\
--output $@

Expand All @@ -186,7 +191,7 @@ $p/berlin-initial-$V-25pct.plans.xml.gz: $p/berlin-activities-$V-25pct.plans.xml
# For debugging and visualization
$(sc) prepare downsample-population $@\
--sample-size 0.25\
--samples 0.1 0.01\
--samples 0.1 0.03 0.01\


$p/berlin-longHaulFreight-$V-25pct.plans.xml.gz: $p/berlin-$V-network.xml.gz
Expand All @@ -198,17 +203,15 @@ $p/berlin-longHaulFreight-$V-25pct.plans.xml.gz: $p/berlin-$V-network.xml.gz
--cut-on-boundary\
--output $@

# TODO: commercial traffic needs to be updated, and network mode correctly mapped
# TODO: both types can be in one file in future

$p/berlin-commercialPersonTraffic-$V-25pct.plans.xml.gz:
$p/berlin-small-scale-commercialTraffic-$V-25pct.plans.xml.gz: $p/berlin-$V-network.xml.gz
$(sc) prepare generate-small-scale-commercial-traffic\
input/commercialTraffic\
input/$V/berlin-$V.config.xml\
--sample 0.25\
--jspritIterations 1\
--creationOption createNewCarrierFile\
--landuseConfiguration useOSMBuildingsAndLanduse\
--smallScaleCommercialTrafficType commercialPersonTraffic\
--network $(notdir $<)\
--smallScaleCommercialTrafficType completeSmallScaleCommercialTraffic\
--zoneShapeFileName $(berlin)/input/shp/berlinBrandenburg_Zones_VKZ_4326.shp\
--buildingsShapeFileName $(berlin)/input/shp/buildings_BerlinBrandenburg_4326.shp\
--landuseShapeFileName $(berlin)/input/shp/berlinBrandenburg_landuse_4326.shp\
Expand All @@ -220,28 +223,8 @@ $p/berlin-commercialPersonTraffic-$V-25pct.plans.xml.gz:

mv output/commercialPersonTraffic/$(notdir $@) $@

$p/berlin-goodsTraffic-$V-25pct.plans.xml.gz:
$(sc) prepare generate-small-scale-commercial-traffic\
input/commercialTraffic\
--sample 0.25\
--jspritIterations 1\
--creationOption createNewCarrierFile\
--landuseConfiguration useOSMBuildingsAndLanduse\
--smallScaleCommercialTrafficType goodsTraffic\
--zoneShapeFileName $(berlin)/input/shp/berlinBrandenburg_Zones_VKZ_4326.shp\
--buildingsShapeFileName $(berlin)/input/shp/buildings_BerlinBrandenburg_4326.shp\
--landuseShapeFileName $(berlin)/input/shp/berlinBrandenburg_landuse_4326.shp\
--shapeCRS "EPSG:4326"\
--resistanceFactor "0.005"\
--numberOfPlanVariantsPerAgent 5\
--nameOutputPopulation $(notdir $@)\
--pathOutput output/goodsTraffic

mv output/goodsTraffic/$(notdir $@) $@



$p/berlin-cadyts-input-$V-25pct.plans.xml.gz: $p/berlin-initial-$V-25pct.plans.xml.gz $p/berlin-commercialPersonTraffic-$V-25pct.plans.xml.gz
$p/berlin-cadyts-input-$V-25pct.plans.xml.gz: $p/berlin-initial-$V-25pct.plans.xml.gz $p/berlin-small-scale-commercialTraffic-$V-25pct.plans.xml.gz
$(sc) prepare merge-populations $^\
--output $@

Expand All @@ -260,7 +243,7 @@ eval-opt: $p/berlin-initial-$V-25pct.experienced_plans.xml.gz
$(sc) prepare run-count-opt\
--input $<\
--network $p/berlin-$V-network-with-pt.xml.gz\
--counts $p/berlin-$V-counts-car-vmz.xml.gz\
--counts $p/berlin-$V-counts-vmz.xml.gz\
--output $p/berlin-$V-25pct.plans_selection_$(ERROR_METRIC).csv\
--metric $(ERROR_METRIC)

Expand All @@ -270,15 +253,14 @@ eval-opt: $p/berlin-initial-$V-25pct.experienced_plans.xml.gz
--output $p/berlin-$V-25pct.plans_$(ERROR_METRIC).xml.gz

$(sc) run --mode "routeChoice" --iterations 20 --all-car --output "output/eval-$(ERROR_METRIC)" --25pct --population "berlin-$V-25pct.plans_$(ERROR_METRIC).xml.gz"\
--config $p/berlin-$V-base-calib.config.xml
--config $p/berlin-$V.config.xml


# TODO: these needs to be renamed to plans-initial, because they are uncalibrated at this stage
# These depend on the output of optimization runs
$p/berlin-$V-25pct.plans.xml.gz: $p/berlin-$V-facilities.xml.gz $p/berlin-$V-network.xml.gz $p/berlin-goodsTraffic-$V-25pct.plans.xml.gz $p/berlin-longHaulFreight-$V-25pct.plans.xml.gz
$p/berlin-$V-25pct.plans-initial.xml.gz: $p/berlin-$V-facilities.xml.gz $p/berlin-$V-network.xml.gz $p/berlin-longHaulFreight-$V-25pct.plans.xml.gz
$(sc) prepare filter-relevant-agents\
--input $p/berlin-$V-25pct.plans_log_error.xml.gz --output $@\
--shp input/v6.0/area/area.shp\
--shp input/$V/area/area.shp\
--facilities $<\
--network $(word 2,$^)

Expand All @@ -292,26 +274,28 @@ $p/berlin-$V-25pct.plans.xml.gz: $p/berlin-$V-facilities.xml.gz $p/berlin-$V-net

$(sc) prepare fix-subtour-modes --input $@ --output $@ --coord-dist 100

$(sc) prepare merge-populations $@ $(word 3,$^) $(word 4,$^)\
$(sc) prepare merge-populations $@ $(word 3,$^)\
--output $@

$(sc) prepare downsample-population $@\
--sample-size 0.25\
--samples 0.1 0.01 0.001\
--samples 0.1 0.03 0.01 0.001\

clean-plans:
$p/berlin-$V-10pct.plans.xml.gz:
$(sc) prepare clean-population\
--plans mode-choice-final-25pct/runs/004/004.output_plans.xml.gz\
--plans mode-choice-10pct-default-v2/runs/008/008.output_plans.xml.gz\
--remove-unselected-plans\
--output mode-choice-final-25pct/runs/004/berlin-$V-25pct.plans.xml.gz
--output $@

$(sc) prepare clean-population\
--plans mode-choice-final/runs/004/004.output_plans.xml.gz\
--remove-unselected-plans\
--output mode-choice-final/runs/004/berlin-$V-10pct.plans.xml.gz
$(sc) prepare downsample-population $@\
--sample-size 0.1\
--samples 0.03 0.01 0.001\

prepare-calibration: $p/berlin-cadyts-input-$V-25pct.plans.xml.gz $p/berlin-$V-network-with-pt.xml.gz $p/berlin-$V-counts-car-vmz.xml.gz
prepare-calibration: $p/berlin-cadyts-input-$V-25pct.plans.xml.gz $p/berlin-$V-network-with-pt.xml.gz $p/berlin-$V-counts-vmz.xml.gz
echo "Done"

prepare: $p/berlin-$V-25pct.plans.xml.gz $p/berlin-$V-network-with-pt.xml.gz
prepare-initial: $p/berlin-$V-25pct.plans-initial.xml.gz $p/berlin-$V-network-with-pt.xml.gz
echo "Done"

prepare: $p/berlin-$V-10pct.plans.xml.gz
echo "Done"
Loading

0 comments on commit 4ba494f

Please sign in to comment.