Skip to content

Commit

Permalink
V1.2 (#31)
Browse files Browse the repository at this point in the history
* suggestion for first steps

* suggestion for first steps

* filter network

* Add examples dependency

* Add files via upload

* commit test idea

* create sample population

* first version that might structurally work.  Still failing because of issues with data model

* changes around parking.  pull up matsim version

* example for shp file based test

* now seems to be working.  Problem was that the chessboard example uses facilities from file.  I cannot say if they are not set up correctly or if that execution path is not fully debugged, but it is something that we rarely use at VSP.  The output now is as follows.  Can't say if we should stick with the parking activity, or just use car interaction.
2023-04-25T04:45:12,079  WARN LeipzigRouterPlanAlgorithm:62 returning LeipzigPlanRouter
2023-04-25T04:45:12,080  WARN LeipzigRouterPlanAlgorithm:69 === old plan: ===
2023-04-25T04:45:12,083  WARN LeipzigRouterPlanAlgorithm:71 act [type=leisure][coord=null][linkId=80][startTime=undefined][endTime=01:00:00][duration=undefined][facilityId=f_auto_80]
2023-04-25T04:45:12,095  WARN LeipzigRouterPlanAlgorithm:71 leg [mode=walk][depTime=01:00:00][travTime=00:00:00][arrTime=01:00:00][route= startLinkId=80 endLinkId=80 travTime=0.0 dist=0.0]
2023-04-25T04:45:12,095  WARN LeipzigRouterPlanAlgorithm:71 act [type=car interaction][coord=[x=7000.0 | y=7000.0]][linkId=80][startTime=undefined][endTime=undefined][duration=00:00:00][facilityId=null]
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:71 leg [mode=car][depTime=01:00:00][travTime=00:13:19][arrTime=01:13:19][route= startLinkId=80 endLinkId=81 travTime=799.0 dist=7000.0 linkIds=[170, 44, 134, 133, 36, 178] travelCost=2.6666600000000003]
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:71 act [type=car interaction][coord=[x=8000.0 | y=7000.0]][linkId=81][startTime=undefined][endTime=undefined][duration=00:00:00][facilityId=null]
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:71 leg [mode=walk][depTime=01:13:19][travTime=00:00:00][arrTime=01:13:19][route= startLinkId=81 endLinkId=81 travTime=0.0 dist=0.0]
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:71 act [type=leisure][coord=null][linkId=81][startTime=undefined][endTime=undefined][duration=undefined][facilityId=f_auto_81]
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:73 ======
2023-04-25T04:45:12,096  WARN LeipzigRouterPlanAlgorithm:82 fromFacility=[org.matsim.facilities.ActivityFacilityImpl@d84b3a2 ID=f_auto_80| linkID=80| nof_activities=1]
2023-04-25T04:45:12,097  INFO NetworkImpl:419 building QuadTree for nodes: xrange(-1.0,9001.0); yrange(-1.0,9001.0)
2023-04-25T04:45:12,099  INFO NetworkImpl:428 Building QuadTree took 0.001 seconds.
2023-04-25T04:45:12,101  WARN LeipzigRouterPlanAlgorithm:141 === new plan: ===
2023-04-25T04:45:12,101  WARN LeipzigRouterPlanAlgorithm:143 act [type=leisure][coord=null][linkId=80][startTime=undefined][endTime=01:00:00][duration=undefined][facilityId=f_auto_80]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 leg [mode=walk][depTime=01:00:00][travTime=00:00:00][arrTime=01:00:00][route= startLinkId=80 endLinkId=169 travTime=0.0 dist=0.0]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 act [type=parking interaction][coord=null][linkId=169][startTime=undefined][endTime=undefined][duration=00:00:00][facilityId=null]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 leg [mode=car][depTime=01:00:00][travTime=00:13:21][arrTime=01:13:21][route= startLinkId=169 endLinkId=81 travTime=801.0 dist=7000.0 linkIds=[79, 124, 34, 35, 36, 178] travelCost=2.6711066666666667]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 act [type=car interaction][coord=[x=8000.0 | y=7000.0]][linkId=81][startTime=undefined][endTime=undefined][duration=00:00:00][facilityId=null]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 leg [mode=walk][depTime=01:13:21][travTime=00:00:00][arrTime=01:13:21][route= startLinkId=81 endLinkId=81 travTime=0.0 dist=0.0]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:143 act [type=leisure][coord=null][linkId=81][startTime=undefined][endTime=undefined][duration=undefined][facilityId=f_auto_81]
2023-04-25T04:45:12,102  WARN LeipzigRouterPlanAlgorithm:145 ======

* add funtionality to tag residentialParking on persons

* start implementing assert statements

* continued parking test, implemented normal to restricted

* continued parking test

* continued parking test, started with shopping still WIP

* some comments

* some refactoring

* some refactoring

* set parking link attr names to fixed from LeipzigUtils

* complete switch from parkingCostConfig to LeipzigUtils

* first try to clean up test + algo class and apply a more specific name pattern

* commercial traffic updates

* remove unused imports

* Revert "first try to clean up test + algo class and apply a more specific name pattern"

This reverts commit 4e07fd5.

* make attr names non-editable

* finish up test case impl: renaming, create missing test cases

* corrections on case parkingLogicLpz to parkingLogicLpz such that there are no doubled car trips anymore

* make getters for attr names package private

* remove unnecessary shoppingNetwork as this is done now differently

* moved LeipzigRouterPlanAlgorithm

* extract and move LeipzigRoutingStrategyProvider

* added parking to run class for a test run

* comment + todo on vspDefaults

* checkstyle

* bugfix

* small changes to LeipzigRouterPlanAlgorithm, now getting parking behaviour based on facilities, added everything to run class and the test

* bugfix re assignment of parking cost

* add routing mode to parkingBehaviour

* parkingBehaviourType parkingSearchLogicLeipzig only for routingModes car, ride and freight

* enable parkingLogicLeipzig only for mode car

* checkstyle

* better integration of the new ReRoute Strategy into the run class

* set name of new ReRouteStrategy in LeipzigRoutingStrategyProvider

* remove logging statements meant for debugging and add todo to the run class

* add leipzig prepare person for parking

* modified PreparePersonForParking so we have the special parking logic already in iteration 0

* fixed some style issues and suppressed the rest

* fix wrong import

* cleanup

* ensure xy2link in the parking preparation

* finished some todos

* fix checkstyle

* cleanup some style issues

* few more style fixes

* started with parking locations analysis

* setup trip dashboards

* update calibrate script

* config update

* add subtour replanning that uses the leipzig re routing

* adding counter to parking locations analysis

* only adding the necessary nodes to the reduced network, to fix wrong parking locations

* change method for checking if link is inside of geometry. it is more precise now

* commercial traffic updates

* remove unused imports

* setup trip dashboards

* update calibrate script

* config update

* add subtour replanning that uses the leipzig re routing

* fix shp path

* add shopping so agents who perform shopping activities can park in the residential zone too

* write out agents who perform parking activities

* fix networking filtering so we have no more issues with nodes being inside the residential area

* fix checkstyle issues

* update config, added counts

* update calibrate script

* reduce todo severity

* reduce todo severity

* update ride parameters

* annotate parking capacities with deprecated as it is not used anymore

* update config and matsim version

* fix typo

* make creation of DrtStops + intermodal TransitSchedule part of run class (#27)

* make creation of DrtStops + intermodal TransitSchedule part of RunLeipzigScenario (WIP)

* add TODO

* prepare extraction of drt config to class

* Code review masterscript (#30)

* analysis runs without errors, added basic loop option

* updated analysis scripts in order to do winner/loser analysis

* WIP but working

* Heatmaps implemented

* WIP new master drt script

* Add files via upload

* modified .gitignore to exclude Rstudio dot files

* updated shape file paths, updated winner-loser analysis to sourcemethods from matsim-r library instead of utils_jr.R file

* WIP drt skript, output needs to be checked

* WIP DRT complete, naming needs to be revisited

* small fixes re paths + dir creation

* tried to plot all demographic differences

* WIP nearly done - DRT done, variable names changes, sankey and winner-loser still need work/merging

* cleaned up equity / winner loser analysis

* bug fixes

* ready for final checks/revisions

* bug fixes

* fixed naming issues

* changing relative paths in r masterscript

* code review and added some todos - SME, GR, MK

* code review and added some todos - SME, GR, MK

* cleanup scripts +  add missing carfree area analysis

* further debugging + cleaning of scripts to make them ready to go

* some comments

* further clean up + make all scripts runnable

* some comments + corrections

* mode av is only analyzed when there are av trips

* bug fixes + some comments

* delete unnecessary traffic volumes analysis (this is done in java anyways)

* smaller bug fixes + generalizations in analysis

* make runId of emissions analysis modifiable

* runId not needed anymore when using string search patterns for files

* make outputDir modifiable if wished

* add / when missing

* checkstyle

---------

Co-authored-by: j-bnsch <[email protected]>
Co-authored-by: Jakob Rehmann <[email protected]>
Co-authored-by: mkreuschner <[email protected]>
Co-authored-by: mkreuschnervsp <[email protected]>

* move drt configs into DrtCaseSetup class, not tested yet

* drt automation almost ready

* add config file with updated car+ride prices and new ride scoring parameters

* further improvements of DRT automation WIP

* bugfix

* update input files to new drt automation

* final steps of drt input automation done

* fix NetworkOptionsTest

* intermodal configs in code

* bugfix

* sonarcloud bug fixes

* sonarcloud bug fixes

* simplify calling of optionals

* add missing imports

* update test and config to v1.2

---------

Co-authored-by: j-bnsch <[email protected]>
Co-authored-by: Jakob Rehmann <[email protected]>
Co-authored-by: mkreuschner <[email protected]>
Co-authored-by: mkreuschnervsp <[email protected]>
Co-authored-by: vsp-gleich <[email protected]>

* some cleanup

* update matsim version

* add drt extensions for dashboards

* fix imports

* added test for parking locations

* add TODO

* v1.2 routes ref

* add enum case for teleported bike

* python script to create reference data

* updated mode shares and scripts so that R and python is consistent

* switch back to specific PR version

* final mode share update

* update initial asc

* update build scripts

* update config, small cleanup

* remove import

* update calibrated parameters

* update values

* add monetaryDistanceRate for ride

* use snz activity types for parking logic and tests

* also update parking cost handler test

* add parking test with leipzig run class

* Revert "add parking test with leipzig run class"

This reverts commit ce85ca3.

* Revert "also update parking cost handler test"

This reverts commit c90772a.

* Revert "use snz activity types for parking logic and tests"

This reverts commit 47b6617.

* make 10pct the default scenario

* fix integration test

---------

Co-authored-by: Kai Nagel <[email protected]>
Co-authored-by: simei94 <[email protected]>
Co-authored-by: mkreuschner <[email protected]>
Co-authored-by: GregorRyb <[email protected]>
Co-authored-by: GregorRyb <[email protected]>
Co-authored-by: simei94 <[email protected]>
Co-authored-by: j-bnsch <[email protected]>
Co-authored-by: Jakob Rehmann <[email protected]>
Co-authored-by: mkreuschnervsp <[email protected]>
Co-authored-by: vsp-gleich <[email protected]>
  • Loading branch information
11 people authored Dec 6, 2023
1 parent c981f68 commit ae2d616
Show file tree
Hide file tree
Showing 58 changed files with 1,559 additions and 1,537 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
path: staging

env:
MAVEN_OPTS: -Xmx10G
MAVEN_OPTS: -Xmx512m
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

env:
MAVEN_OPTS: -Xmx10G
MAVEN_OPTS: -Xmx512m
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Add own ignores on top, don't edit the template

input/*stops.xml
input/*stops.csv
*.Rhistory
*.RProj




# Common files to ignore when working with matsim
Expand Down
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ osmosis := osmosis/bin/osmosis

NETWORK := germany-220327.osm.pbf
germany := ../shared-svn/projects/matsim-germany
shared := ../shared-svn/projects/NaMAV
shared ?= ../shared-svn/projects/NaMAV

.PHONY: prepare

Expand Down Expand Up @@ -70,13 +70,13 @@ input/sumo.net.xml: input/network.osm


input/$V/leipzig-$V-network.xml.gz: input/sumo.net.xml
$(sc) prepare network-from-sumo $< --output $@
$(sc) prepare network-from-sumo $< --output $@ --free-speed-factor 0.75
$(sc) prepare fix-network $@ --output $@
$(sc) prepare clean-network $@ --output $@ --modes bike

input/$V/leipzig-$V-network-with-pt.xml.gz: input/$V/leipzig-$V-network.xml.gz input/gtfs-lvb.zip
$(sc) prepare transit-from-gtfs --network $< $(filter-out $<,$^)\
--name leipzig-$V --date "2019-06-05" --target-crs $(CRS)\
--name leipzig-$V --date "2023-04-19" --target-crs $(CRS)\
--output input/$V

$(sc) prepare prepare-transit-schedule\
Expand All @@ -90,35 +90,36 @@ input/plans-longHaulFreight.xml.gz: input/$V/leipzig-$V-network.xml.gz
--input-crs $(CRS)\
--target-crs $(CRS)\
--shp ../shared-svn/projects/NaMAV/data/shapefiles/freight-area/freight-area.shp\
--cut-on-boundary\
--output $@

input/plans-commercialTraffic.xml.gz:
input/plans-completeSmallScaleCommercialTraffic.xml.gz:
$(sc) prepare generate-small-scale-commercial-traffic\
input/commercialTraffic\
--sample 0.25\
--jspritIterations 1\
--creationOption createNewCarrierFile\
--landuseConfiguration useOSMBuildingsAndLanduse\
--trafficType commercialTraffic\
--smallScaleCommercialTrafficType completeSmallScaleCommercialTraffic\
--zoneShapeFileName $(shared)/data/input-commercialTraffic/leipzig_zones_25832.shp\
--buildingsShapeFileName $(shared)/data/input-commercialTraffic/leipzig_buildings_25832.shp\
--landuseShapeFileName $(shared)/data/input-commercialTraffic/leipzig_landuse_25832.shp\
--shapeCRS "EPSG:25832"\
--resistanceFactor "0.005"\
--nameOutputPopulation $(notdir $@)\
--PathOutput output/commercialTraffic
--pathOutput output/commercialTraffic

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

input/$V/leipzig-$V-25pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz input/plans-commercialTraffic.xml.gz
input/$V/leipzig-$V-25pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.gz input/plans-completeSmallScaleCommercialTraffic.xml.gz
$(sc) prepare trajectory-to-plans\
--name prepare --sample-size 0.25\
--max-typical-duration 0\
--output input/\
--population $(shared)/matsim-input-files/senozon/20210520_leipzig/population.xml.gz\
--attributes $(shared)/matsim-input-files/senozon/20210520_leipzig/personAttributes.xml.gz

$(sc) prepare population input/prepare-25pct.plans.xml.gz\
$(sc) prepare population input/prepare-25pct.plans.xml.gz --phase pre\
--shp $(shared)/matsim-input-files/senozon/20210520_leipzig/dilutionArea.shp --shp-crs $(CRS)\
--output input/prepare-25pct.plans.xml.gz

Expand All @@ -143,11 +144,16 @@ input/$V/leipzig-$V-25pct.plans-initial.xml.gz: input/plans-longHaulFreight.xml.

$(sc) prepare split-activity-types-duration\
--input input/prepare-25pct.plans-with-trips.xml.gz\
--exclude commercial_start,commercial_end,freight_start,freight_end\
--output $@

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

$(sc) prepare merge-populations $@ $< --output $@
$(sc) prepare population $@ --phase post\
--shp $(shared)/matsim-input-files/senozon/20210520_leipzig/dilutionArea.shp --shp-crs $(CRS)\
--output $@

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

$(sc) prepare extract-home-coordinates $@ --csv input/$V/leipzig-$V-homes.csv

Expand All @@ -166,8 +172,8 @@ check: input/$V/leipzig-$V-25pct.plans-initial.xml.gz
$(sc) analysis check-population $<\
--input-crs $(CRS)\
--attribute carAvail\
--shp ../shared-svn/projects/NaMAV/data/leipzig-utm32n/leipzig-utm32n.shp\
--shp ../shared-svn/projects/NaMAV/data/shapefiles/leipzig-utm32n/leipzig-utm32n.shp\

# Aggregated target
prepare: input/$V/leipzig-$V-25pct.plans-initial.xml.gz input/$V/leipzig-$V-network-with-pt.xml.gz
echo "Done"
echo "Done"
File renamed without changes.
Binary file added input/v1.2/drtServiceArea/Leipzig_stadt.dbf
Binary file not shown.
File renamed without changes.
Binary file added input/v1.2/drtServiceArea/Leipzig_stadt.shp
Binary file not shown.
Binary file added input/v1.2/drtServiceArea/Leipzig_stadt.shx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit ae2d616

Please sign in to comment.