Step 1: Building a simple MATSim model - Hussein-Mahfouz/matsim-drt GitHub Wiki
I will make these notes as I go long, mainly for my own reference in the future
there are two options - as shown here: https://phoenixnap.com/kb/install-maven-on-ubuntu
- using apt
- installing manually (follow the instructions in the link)
- Ensure you have "Extension Pack for Java"
- Ctrl + Shift + p -> Maven: New Project
- Add Group.Id and Artifact.id
- Group id was com.hussein.mahfouz
- folder (artifact.id) as the root directory: https://github.com/jibeproject/matsim-jibe
- multiple maven projects in one repo: https://github.com/eqasim-org/eqasim-java
You can run python through maven. Better to have python in seperate root folder for dependancy management etc
Add dependancies under <dependencies>
section.
\# Navigate to the project directory
cd /path/to/your/project
\# Clean the project
mvn clean
\# Compile the project
mvn compile
- PT2MATSim wiki: https://github.com/matsim-org/pt2matsim/wiki
- Create a wrapper class for each class you want to use from pt2matsim (
Osm2MultimodalNetwork
,Gtfs2TransitSchedule
,CreateDefaultPTMapperConfig
)- Example link
- The default pt2matsim OSMConverter config only considers main modes (car, pt). If you want to include other modes in your simulation (e.g. car_passenger), then you need to add them as done here
- These modes should also be in the modesToKeepOnCleanup, see here
- After running
Gtfs2TransitSchedule
, check the vehicles_unmapped file. It has capacity of different vehicle types. These are obtained from google. see here. If you need to change any manually, you can do so by editing the xml file. For example, I am not sure ifCoach Service
should map onto rail and hve 400 seats
- This is your activity-based model. I am using the one I created here: https://github.com/Urban-Analytics-Technology-Platform/acbm
- The crs should match the transport supply crs and should be a projected crs. Don't rely on matsim for crs conversion
- See code here
- you can run simulation with current input data (plans + network + pt mapped)
- try to run a matsim simulaiton without mode choice (rerouting only). This will test that network is ok
- Use simuntu via to check PT supply
-
Generate a matsim config file. See here
-
Remove the code below and then set simulate PT = TRUE
-
Edit the following modules (all relative paths to the config)
- transit
- network
- plans
-
activityParams
- For each activity add a parameter set. See here. Some values can be kept as "undefined" (the default)
- These are only relevant to scoring. They are not used when relying on DCM, but MATSim expects them to exist in the config
-
Replanning strategy
- On MATSim libs repository, you can see configs of different scenarios (with different replanning strategies)
- Copy reroute strategy from here: https://github.com/matsim-org/matsim-libs/blob/72b849e755d4c6c3131be5c4b31be62ce1b5d7eb/examples/scenarios/siouxfalls-2014/config_default.xml#L111
- Only use reroute for now
-
Edit output directory
-
CRS:
- Do not rely on MATSim for crs conversion. All inputs should be in the same projected crs
- Edit
<module name="global"><param name="coordinateSystem" value="Atlantis"></param></module>
and change it to your CRS. This is not necessary
-
Facilities:
<param name="facilitiesSource" value="none" />
- see: https://github.com/Hussein-Mahfouz/matsim-drt/issues/8 -
transitRouter
-
directWalkFactor
should be set to a high number (e.g. 5) - explanation: walking should be decided by mode choice, not by the router
-
To Run:
- check RunSimulation