Skip to content

Commit

Permalink
implemented plan builder for daily plans
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Aug 8, 2024
1 parent f842282 commit cf1227f
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 68,050 deletions.
37 changes: 32 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $(JAR):

# Required files
input/kansai.osm.pbf:
curl https://download.geofabrik.de/asia/japan/kansai-210101.osm.pbf -o $@
curl https://download.geofabrik.de/asia/japan/kansai-240101.osm.pbf -o $@

input/network.osm: input/kansai.osm.pbf

Expand Down Expand Up @@ -59,8 +59,10 @@ input/sumo.net.xml: input/network.osm


input/$V/$N-$V-network.xml.gz: input/sumo.net.xml
$(sc) prepare network-from-sumo $<\
--target-crs $(CRS) --output $@
$(sc) prepare network-from-sumo $< --target-crs $(CRS) --output $@

$(sc) prepare clean-network $@ --output $@ --modes car,ride,truck --remove-turn-restrictions


input/$V/$N-$V-network-with-pt.xml.gz: input/$V/$N-$V-network.xml.gz
# FIXME: Adjust GTFS
Expand All @@ -86,6 +88,7 @@ input/facilities.gpkg: input/kansai.osm.pbf

input/$V/$N-$V-facilities.xml.gz: input/$V/$N-$V-network.xml.gz input/facilities.gpkg
$(sc) prepare facilities --network $< --shp $(word 2,$^)\
--facility-mapping input/facility_mapping.json\
--output $@

# Static population only contains the home locations
Expand All @@ -98,8 +101,8 @@ input/$V/$N-static-$V-10pct.plans.xml.gz: input/facilities.gpkg
--output $@


# Assigns daily activity chains (without locations)
input/$V/$N-$V-10pct.plans-initial.xml.gz: input/$V/$N-static-$V-10pct.plans.xml.gz input/$V/$N-$V-facilities.xml.gz input/$V/$N-$V-network.xml.gz
# Assigns daily activity chains including locations
input/$V/$N-activities-$V-10pct.plans.xml.gz: input/$V/$N-static-$V-10pct.plans.xml.gz input/$V/$N-$V-facilities.xml.gz input/$V/$N-$V-network.xml.gz
$(sc) prepare create-daily-plans --input $< --output $@\
--persons src/main/python/table-persons.csv\
--activities src/main/python/table-activities.csv\
Expand All @@ -108,6 +111,30 @@ input/$V/$N-$V-10pct.plans-initial.xml.gz: input/$V/$N-static-$V-10pct.plans.xml
--network $(word 3,$^)\


input/$V/$N-$V-10pct.plans-initial.xml.gz: input/$V/$N-activities-$V-10pct.plans.xml.gz input/$V/$N-$V-facilities.xml.gz input/$V/$N-$V-network.xml.gz

$(sc) prepare filter-relevant-agents\
--input $< --output $@\
--input-crs $(CRS)\
--shp input/area.gpkg\
--facilities $(word 2,$^)\
--network $(word 3,$^)

$(sc) prepare split-activity-types-duration\
--exclude commercial_start,commercial_end,freight_start,freight_end\
--input $@ --output $@

$(sc) prepare set-car-avail --input $@ --output $@

$(sc) prepare check-car-avail --input $@ --output $@ --mode walk

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

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


# Aggregated target for input plans to calibration
prepare: input/$V/$N-$V-10pct.plans-initial.xml.gz input/$V/$N-$V-network-with-pt.xml.gz
echo "Done"
8 changes: 7 additions & 1 deletion input/activity_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
"sports_hall": ["leisure", "work"],
"stadium": ["leisure", "work"],
"apartments": ["resident"],
"yes": ["resident"]
"yes": ["resident"],
"house": ["resident"],
"detached": ["resident"],
"semidetached_house": ["resident"],
"bungalow": ["resident"],
"terrace": ["resident"],
"residential": ["resident"]
},
"amenity": {
"bar": ["leisure", "work", "delivery", "dining"],
Expand Down
Binary file modified input/area.gpkg
Binary file not shown.
14 changes: 14 additions & 0 deletions input/facility_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"work": ["work", "work_business"],
"shop": ["shopping", "leisure"],
"shop_daily": ["shopping"],
"leisure": ["leisure"],
"dining": ["leisure"],
"edu_higher": ["edu"],
"edu_prim": ["edu", "edu"],
"edu_kiga": ["edu"],
"edu_other": ["edu"],
"p_business": ["personal_business", "work_business"],
"medical": ["personal_business"],
"religious": ["personal_business"]
}
68,029 changes: 0 additions & 68,029 deletions input/v1.0/kyoto-v1.0-network-linkGeometries.csv

This file was deleted.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<dependency>
<groupId>com.github.matsim-scenarios</groupId>
<artifactId>matsim-berlin</artifactId>
<version>6.3-SNAPSHOT</version>
<!-- <version>d9f763ffbc</version>-->
<!-- <version>6.3-SNAPSHOT</version>-->
<version>0b10118f80</version>
</dependency>


Expand Down
Loading

0 comments on commit cf1227f

Please sign in to comment.