Skip to content

Commit

Permalink
Merge pull request #12 from matsim-scenarios/main
Browse files Browse the repository at this point in the history
merge main into v1.1_ride-experiment
  • Loading branch information
simei94 authored Sep 17, 2024
2 parents 0faa1dc + 5dc6d1c commit fb9e03b
Show file tree
Hide file tree
Showing 32 changed files with 2,012 additions and 543 deletions.
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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
59 changes: 51 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JAR := matsim-$(N)-*.jar
osmosis := osmosis/bin/osmosis
germany := ../shared-svn/projects/matsim-germany
shared := ../shared-svn/projects/DiTriMo
lausitz := ../public-svn/matsim/scenarios/countries/de/lausitz/lausitz-$V
lausitz := ../public-svn/matsim/scenarios/countries/de/lausitz/input/$V

MEMORY ?= 20G
SUMO_HOME ?= $(abspath ../../sumo-1.18.0/)
Expand Down Expand Up @@ -38,7 +38,7 @@ input/network.osm: $(NETWORK)
--tf accept-ways highway=motorway,motorway_link,motorway_junction,trunk,trunk_link,primary,primary_link\
--used-node --wb input/network-germany.osm.pbf

# put the 3 above networks together and remove raia
# put the 3 above networks together and remove railway
$(osmosis) --rb file=input/network-germany.osm.pbf --rb file=input/network-coarse.osm.pbf --rb file=input/network-detailed.osm.pbf\
--merge --merge\
--tag-transform file=input/remove-railway.xml\
Expand Down Expand Up @@ -71,9 +71,15 @@ input/$V/$N-$V-network.xml.gz: input/sumo.net.xml
$(sc) prepare network-from-sumo $< --output $@ --free-speed-factor 0.75
$(sc) prepare clean-network $@ --output $@ --modes car --modes bike

# add freight modes as allowed modes
# add hbefa attributes as link attributes
input/$V/$N-$V-network-freight-hbefa.xml.gz: input/$V/$N-$V-network.xml.gz
$(sc) prepare network\
--network $<\
--output $@

#add pt to network from german wide gtfs, but only for area of shp file
input/$V/$N-$V-network-with-pt.xml.gz: input/$V/$N-$V-network.xml.gz
input/$V/$N-$V-network-with-pt.xml.gz: input/$V/$N-$V-network-freight-hbefa.xml.gz
$(sc) prepare transit-from-gtfs --network $<\
--output=input/$V\
--name $N-$V --date "2023-01-11" --target-crs $(CRS) \
Expand All @@ -87,13 +93,50 @@ input/$V/$N-$V-network-with-pt.xml.gz: input/$V/$N-$V-network.xml.gz

# extract lausitz long haul freight traffic trips from german wide file
input/plans-longHaulFreight.xml.gz: input/$V/$N-$V-network.xml.gz
$(sc) prepare extract-freight-trips ../public-svn/matsim/scenarios/countries/de/german-wide-freight/v2/german_freight.25pct.plans.xml.gz\
$(sc) prepare extract-freight-trips ../public-svn/matsim/scenarios/countries/de/german-wide-freight/v2/german_freight.100pct.plans.xml.gz\
--network ../public-svn/matsim/scenarios/countries/de/german-wide-freight/v2/germany-europe-network.xml.gz\
--input-crs $(CRS)\
--target-crs $(CRS)\
--shp input/shp/lausitz.shp --shp-crs $(CRS)\
--cut-on-boundary\
--LegMode "longDistanceFreight"\
--output $@
# create facilities for commercial traffic
input/commercialFacilities.xml.gz:
$(sc) prepare create-data-distribution-of-structure-data\
--outputFacilityFile $@\
--outputDataDistributionFile $(shared)/data/commercial_traffic/input/commercialTraffic/dataDistributionPerZone.csv\
--landuseConfiguration useOSMBuildingsAndLanduse\
--regionsShapeFileName $(shared)/data/commercial_traffic/input/commercialTraffic/lausitz_regions_25832.shp\
--regionsShapeRegionColumn "GEN"\
--zoneShapeFileName $(shared)/data/commercial_traffic/input/commercialTraffic/lausitz_zones_25832.shp\
--zoneShapeFileNameColumn "GEN"\
--buildingsShapeFileName $(shared)/data/commercial_traffic/input/commercialTraffic/lausitz_buildings_25832.shp\
--shapeFileBuildingTypeColumn "building"\
--landuseShapeFileName $(shared)/data/commercial_traffic/input/commercialTraffic/lausitz_landuse_25832.shp\
--shapeFileLanduseTypeColumn "landuse"\
--shapeCRS "EPSG:25832"\
--pathToInvestigationAreaData $(shared)/data/commercial_traffic/input/commercialTraffic/commercialTrafficAreaData.csv
# generate small scale commercial traffic
input/lausitz-small-scale-commercialTraffic-$V-100pct.plans.xml.gz: input/$V/$N-$V-network.xml.gz input/commercialFacilities.xml.gz
$(sc) prepare generate-small-scale-commercial-traffic\
input/$V/lausitz-$V-100pct.config.xml\
--pathToDataDistributionToZones $(shared)/data/commercial_traffic/input/commercialTraffic/dataDistributionPerZone.csv\
--pathToCommercialFacilities $(word 2,$^)\
--sample 1.0\
--jspritIterations 10\
--creationOption createNewCarrierFile\
--network $<\
--smallScaleCommercialTrafficType completeSmallScaleCommercialTraffic\
--zoneShapeFileName $(shared)/data/commercial_traffic/input/commercialTraffic/lausitz_zones_25832.shp\
--zoneShapeFileNameColumn "GEN"\
--shapeCRS "EPSG:25832"\
--numberOfPlanVariantsPerAgent 5\
--nameOutputPopulation $@\
--pathOutput output/commercialPersonTraffic

mv output/commercialPersonTraffic/$@ $@


# trajectory-to-plans formerly was a collection of methods to prepare a given population
# now, most of the functions of this class do have their own class (downsample, splitduration types...)
Expand All @@ -113,7 +156,7 @@ input/$V/prepare-100pct.plans.xml.gz:
--landuse $(germany)/landuse/landuse.shp\
--output $@

input/$V/$N-$V-100pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz input/$V/prepare-100pct.plans.xml.gz
input/$V/$N-$V-100pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz input/$V/prepare-100pct.plans.xml.gz input/lausitz-small-scale-commercialTraffic-$V-100pct.plans.xml.gz

# generate some short distance trips, which in senozon data generally are missing
# trip range 700m because:
Expand All @@ -126,7 +169,7 @@ input/$V/$N-$V-100pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz i
--range 700\
--num-trips 324430

# adapt coords of activitzies in the wider network such that they are closer to a link
# adapt coords of activities in the wider network such that they are closer to a link
# such that agents do not have to walk as far as before
$(sc) prepare adjust-activity-to-link-distances input/$V/prepare-100pct.plans-with-trips.xml.gz\
--shp input/shp/lausitz.shp --shp-crs $(CRS)\
Expand All @@ -144,11 +187,11 @@ input/$V/$N-$V-100pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz i
# split activity types to type_duration for the scoring to take into account the typical duration
$(sc) prepare split-activity-types-duration\
--input $@\
--exclude commercial_start,commercial_end,freight_start,freight_end\
--exclude commercial_start,commercial_end,freight_start,freight_end,service\
--output $@

# merge person and freight pops
$(sc) prepare merge-populations $@ $< --output $@
$(sc) prepare merge-populations $@ $< $(word 3,$^) --output $@

$(sc) prepare downsample-population $@\
--sample-size 1\
Expand Down
20 changes: 8 additions & 12 deletions input/v1.1/lausitz-v1.1-10pct.config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

<module name="network">
<param name="inputNetworkFile"
value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/lausitz/input/v1.0/lausitz-v1.0-network-with-pt.xml.gz"/>
value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/lausitz/input/v1.1/lausitz-v1.1-network-with-pt.xml.gz"/>
<param name="laneDefinitionsFile" value="null"/>
</module>

<module name="plans">
<param name="inputPlansFile"
value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/lausitz/input/v1.0/lausitz-v1.0-10pct.plans.xml.gz"/>
value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/lausitz/input/v1.1/lausitz-v1.1-10pct.plans-initial.xml.gz"/>
<param name="removingUnnecessaryPlanAttributes" value="true"/>
</module>

Expand All @@ -53,7 +53,7 @@
<module name="routing">
<!-- Some typical teleportation routing params are set by default, such as for walk and bike. Setting this switch to "true" will clear them. Note that this will also clear settings for helper modes such as for non_network_walk -->
<param name="clearDefaultTeleportedModeParams" value="true"/>
<param name="networkModes" value="car,ride,bike,freight"/>
<param name="networkModes" value="car,ride,bike,longDistanceFreight"/>
<parameterset type="teleportedModeParameters">
<param name="beelineDistanceFactor" value="1.3"/>
<param name="mode" value="walk"/>
Expand All @@ -65,7 +65,7 @@
<param name="endTime" value="36:00:00"/>
<param name="flowCapacityFactor" value="0.1"/>
<param name="storageCapacityFactor" value="0.1"/>
<param name="mainMode" value="car,bike,freight"/>
<param name="mainMode" value="car,bike,longDistanceFreight"/>
<param name="numberOfThreads" value="12"/>
<param name="startTime" value="00:00:00"/>
<param name="stuckTime" value="30.0"/>
Expand All @@ -85,7 +85,6 @@
<param name="context" value="" />
<param name="mapCenter" value="14.5,51.53" />
<param name="mapZoomLevel" value="6.8" />
<param name="sampleSize" value="0.25" />
<param name="shp" value="../shp/lausitz.shp" />
</parameterset>
</module>
Expand Down Expand Up @@ -133,12 +132,12 @@

<parameterset type="strategysettings">
<param name="strategyName" value="ChangeExpBeta"/>
<param name="subpopulation" value="freight"/>
<param name="subpopulation" value="longDistanceFreight"/>
<param name="weight" value="0.95"/>
</parameterset>
<parameterset type="strategysettings">
<param name="strategyName" value="ReRoute"/>
<param name="subpopulation" value="freight"/>
<param name="subpopulation" value="longDistanceFreight"/>
<param name="weight" value="0.05"/>
</parameterset>
</module>
Expand All @@ -165,7 +164,7 @@
<!-- This parameter decides which modes are analyzed, when separateModes = false && filterModes = true. The 2 latter parameters are only here for backwards compability.
standard is separateModes = true (see below), so analyzedModes is ignored.
In case of separateModes = false && filterModes = true: travel time measurement for all vehicle types together (seperatemodes = false), BUT filtered (filterModes = true) for the modes in analyzedModes-->
<param name="analyzedModes" value="car,freight"/>
<param name="analyzedModes" value="car,longDistanceFreight"/>

<param name="separateModes" value="true"/>
<param name="calculateLinkToLinkTravelTimes" value="false"/>
Expand All @@ -179,9 +178,6 @@
<module name="scoring">
<param name="fractionOfIterationsToStartScoreMSA" value="0.9"/>
<parameterset type="scoringParameters">
<!-- Inflation adjusted -->
<param name="performing" value="6.67"/>

<parameterset type="modeParams">
<param name="constant" value="-0.49074349924922095"/>
<param name="marginalUtilityOfTraveling_util_hr" value="0.0"/>
Expand Down Expand Up @@ -216,7 +212,7 @@

<parameterset type="modeParams">
<param name="marginalUtilityOfTraveling_util_hr" value="-10.0"/>
<param name="mode" value="freight"/>
<param name="mode" value="longDistanceFreight"/>
<param name="monetaryDistanceRate" value="-0.002"/>
<!-- -->
</parameterset>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["ETRS_1989_UTM_Zone_32N",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",9.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fb9e03b

Please sign in to comment.