Skip to content

Commit

Permalink
* add config to scenarios folder
Browse files Browse the repository at this point in the history
* add meaningfull content to readme
* correct type in application script
  • Loading branch information
Janekdererste committed Dec 3, 2021
1 parent d5c416c commit 824cb78
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 28 deletions.
79 changes: 52 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
# matsim-velbert
# The MATSim Open Velbert Scenario

A scenario of the Velbert in Germany. The current version is v1.1. The necessary input files can be optained from the VSP team.


### Import into eclipse
![Velbert MATSim network and agents](scenarios/velbert-v1.1-10pct/velbert-banner.png "Velbert MATSim network and agents")

1. download a modern version of eclipse. This should have maven and git included by default.
1. `file->import->git->projects from git->clone URI` and clone as specified above. _It will go through a
sequence of windows; it is important that you import as 'general project'._
1. `file->import->maven->existing maven projects`
## About this project

Sometimes, step 3 does not work, in particular after previously failed attempts. Sometimes, it is possible to
right-click to `configure->convert to maven project`. If that fails, the best thing seems to remove all
pieces of the failed attempt in the directory and start over.
This repository provides an open MATSim transport model for Velbert, Germany, generated by the [Transport Systems Planning and Transport Telematics group](https://www.vsp.tu-berlin.de) of [Technische Universität Berlin](http://www.tu-berlin.de).

### Import into IntelliJ
<a rel="TU Berlin" href="https://www.vsp.tu-berlin.de"><img src="https://svn.vsp.tu-berlin.de/repos/public-svn/ueber_uns/logo/TUB_Logo.png" width="15%" height="15%"/></a><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a rel="TU Berlin" href="https://vsp.berlin/"><img src="https://vsp.berlin/assets/images/vsp-logo.png" width="15%" height="15%"/></a><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a></a><br/>

`File -> New -> Project from Version Control` paste the repository url and hit 'clone'. IntelliJ usually figures out
that the project is a maven project. If not: `Right click on pom.xml -> import as maven project`.
The model contains a 10pct sample of the Velbert population; road capacities are accordingly reduced. The scenario is calibrated taking into consideration the modal split and mode-specific trip distance distributions.

### Java Version
## Licenses

The project uses Java 11. Usually a suitable SDK is packaged within IntelliJ or Eclipse. Otherwise, one must install a
suitable sdk manually, which is available [here](https://openjdk.java.net/)
The **MATSim program code** in this repository is distributed under the terms of the [GNU General Public License as published by the Free Software Foundation (version 2)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html). The MATSim program code are files that reside in the `src` directory hierarchy and typically end with `*.java`.

The **MATSim input files, output files, analysis data and visualizations** are licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) License</a>.
MATSim input files are those that are used as input to run MATSim. They often, but not always, have a header pointing to matsim.org. They typically reside in the `scenarios` directory hierarchy. MATSim output files, analysis data, and visualizations are files generated by MATSim runs, or by postprocessing. They typically reside in a directory hierarchy starting with `output`.

**Other data files**, in particular in `original-input-data`, have their own individual licenses that need to be individually clarified with the copyright holders.

## Note

Handling of large files within git is not without problems (git lfs files are not included in the zip download; we have to pay; ...). In consequence, large files, both on the input and on the output side, reside at https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.1-10pct .

## Downloading the Project

### Building and Running it locally
You can either download the Project as zip File or check it out as a git project

### Download as zip File

1. Download the [Zip-File](https://github.com/matsim-scenarios/matsim-velbert/archive/refs/heads/master.zip)
2. Unzip the Zip-File
3. Follow the instructions in [Building and Running it locally](##Building and Running it locally)

### Check out as Git project

1. Check out as Git-Project from Github
2. Follow the instructions in [Building and Running it locally](##Building and Running it locally)

## Building and Running it locally

You can build an executable jar-file by executing the following command:

Expand All @@ -35,23 +51,32 @@ You can build an executable jar-file by executing the following command:
or on Windows:

```sh
mvnw.cmd clean package
.\mvnw.cmd clean package
```

This will download all necessary dependencies (it might take a while the first time it is run) and create a file `matsim-example-project-0.0.1-SNAPSHOT.jar` in the top directory. This jar-file can either be double-clicked to start the MATSim GUI, or executed with Java on the command line:

```sh
java -jar matsim-example-project-0.0.1-SNAPSHOT.jar
java -jar matsim-velbert-1.1.jar run --config ./scenarios/velbert-v1.1-10pct/matsim-velbert-v1.1-10pct.config.xml
```

## Import into eclipse

1. download a modern version of eclipse. This should have maven and git included by default.
1. `file->import->git->projects from git->clone URI` and clone as specified above. _It will go through a
sequence of windows; it is important that you import as 'general project'._
1. `file->import->maven->existing maven projects`

Sometimes, step 3 does not work, in particular after previously failed attempts. Sometimes, it is possible to
right-click to `configure->convert to maven project`. If that fails, the best thing seems to remove all
pieces of the failed attempt in the directory and start over.

### Licenses
(The following paragraphs need to be adjusted according to the specifications of your project.)
## Import into IntelliJ

The **MATSim program code** in this repository is distributed under the terms of the [GNU General Public License as published by the Free Software Foundation (version 2)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html). The MATSim program code are files that reside in the `src` directory hierarchy and typically end with `*.java`.
`File -> New -> Project from Version Control` paste the repository url and hit 'clone'. IntelliJ usually figures out
that the project is a maven project. If not: `Right click on pom.xml -> import as maven project`.

The **MATSim input files, output files, analysis data and visualizations** are licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br /> MATSim input files are those that are used as input to run MATSim. They often, but not always, have a header pointing to matsim.org. They typically reside in the `scenarios` directory hierarchy. MATSim output files, analysis data, and visualizations are files generated by MATSim runs, or by postprocessing. They typically reside in a directory hierarchy starting with `output`.
## Java Version

**Other data files**, in particular in `original-input-data`, have their own individual licenses that need to be individually clarified with the copyright holders.
The project uses Java 11. Usually a suitable SDK is packaged within IntelliJ or Eclipse. Otherwise, one must install a
suitable sdk manually, which is available [here](https://openjdk.java.net/)
140 changes: 140 additions & 0 deletions scenarios/velbert-v1.1-10pct/matsim-velbert-v1.1-10pct.config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0"?>
<!DOCTYPE config SYSTEM "http://www.matsim.org/files/dtd/config_v2.dtd">
<config>
<module name="global">
<param name="randomSeed" value="4711"/>
<param name="coordinateSystem" value="EPSG:25832"/>
<param name="numberOfThreads" value="12"/>
</module>
<module name="controler">
<param name="lastIteration" value="500"/>
<param name="overwriteFiles" value="deleteDirectoryIfExists"/>
<param name="runId" value="matsim-velbert-v1.1"/>
<param name="outputDirectory" value="../output/"/>
<param name="writeEventsInterval" value="50"/>
<param name="writePlansInterval" value="50"/>
</module>
<module name="qsim">
<param name="endTime" value="36:00:00"/>
<param name="flowCapacityFactor" value="0.1"/>
<param name="mainMode" value="car"/>
<param name="numberOfThreads" value="12"/>
<param name="startTime" value="00:00:00"/>
<param name="storageCapacityFactor" value="0.1"/>
<param name="stuckTime" value="30.0"/>
<param name="trafficDynamics" value="queue"/>
<param name="vehiclesSource" value="modeVehicleTypesFromVehiclesData"/>
<param name="insertingWaitingVehiclesBeforeDrivingVehicles" value="true"/>
<param name="usePersonIdForMissingVehicleId" value="false"/>
</module>
<module name="network">
<param name="inputNetworkFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.0/input/matsim-velbert-v1.0.network.xml.gz"/>
</module>
<module name="plans">
<param name="inputPlansFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.1-10pct/input/matsim-velbert-v1.1-10pct.plans.xml.gz"/>
</module>
<module name="vehicles">
<param name="vehiclesFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.0/input/matsim-velbert-v1.0.vehicles.xml.gz"/>
</module>
<module name="transit">
<param name="transitScheduleFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.0/input/matsim-velbert-v1.0.transit-schedule.xml.gz"/>
<param name="useTransit" value="true"/>
<param name="vehiclesFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/velbert/velbert-v1.0/input/matsim-velbert-v1.0.transit-vehicles.xml.gz"/>
</module>
<module name="transitRouter">
<param name="extensionRadius" value="500.0"/>
<!-- Factor with which direct walk generalized cost is multiplied before it is compared to the pt generalized cost. Set to a very high value to reduce direct walk results. -->
<param name="directWalkFactor" value="1.0"/>
<!-- maximum beeline distance between stops that agents could transfer to by walking -->
<param name="maxBeelineWalkConnectionDistance" value="300.0"/>
</module>
<module name="planscalcroute">
<param name="networkModes" value="car,ride"/>
<param name="clearDefaultTeleportedModeParams" value="true"/>
<parameterset type="teleportedModeParameters">
<param name="beelineDistanceFactor" value="1.4"/>
<param name="mode" value="walk"/>
<param name="teleportedModeFreespeedFactor" value="null"/>
<param name="teleportedModeSpeed" value="1.1111111111111112"/>
</parameterset>
<parameterset type="teleportedModeParameters">
<param name="beelineDistanceFactor" value="1.4"/>
<param name="mode" value="bike"/>
<param name="teleportedModeFreespeedFactor" value="null"/>
<param name="teleportedModeSpeed" value="3.0555555555555554"/>
</parameterset>
</module>
<module name="travelTimeCalculator">
<param name="analyzedModes" value="car"/>
<param name="separateModes" value="true"/>
</module>
<module name="planCalcScore">
<param name="fractionOfIterationsToStartScoreMSA" value="1.0"/>
<parameterset type="scoringParameters">
<parameterset type="modeParams">
<param name="constant" value="-1.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value="-1.5"/>
<param name="mode" value="pt"/>
<param name="dailyMonetaryConstant" value="-2.3"/>
</parameterset>
<parameterset type="modeParams">
<param name="constant" value="-1.5"/>
<param name="marginalUtilityOfTraveling_util_hr" value="0"/>
<param name="mode" value="car"/>
<param name="monetaryDistanceRate" value="-0.0002"/>
<param name="dailyMonetaryConstant" value="-5.3"/>
</parameterset>
<!-- fixed, so no asc -->
<parameterset type="modeParams">
<param name="constant" value="0"/>
<param name="marginalUtilityOfTraveling_util_hr" value="0"/>
<param name="mode" value="ride"/>
<param name="monetaryDistanceRate" value="-0.0002"/>
</parameterset>
<parameterset type="modeParams">
<param name="constant" value="0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value="-1.5"/>
<param name="mode" value="walk"/>
</parameterset>
<parameterset type="modeParams">
<param name="constant" value="-0.75"/>
<param name="marginalUtilityOfTraveling_util_hr" value="-6.5"/>
<param name="mode" value="bike"/>
</parameterset>
</parameterset>
</module>
<module name="strategy">
<param name="fractionOfIterationsToDisableInnovation" value="0.8"/>
<parameterset type="strategysettings">
<param name="strategyName" value="ChangeExpBeta"/>
<param name="weight" value="0.7"/>
<param name="subpopulation" value="person"/>
</parameterset>
<parameterset type="strategysettings">
<param name="strategyName" value="ReRoute"/>
<param name="weight" value="0.1"/>
<param name="subpopulation" value="person"/>
</parameterset>
<!-- we use ChangeSingleTripMode here because SubtourModeChoice didn't seem to work due to the high number of
plans which don't have home as last activity -->
<parameterset type="strategysettings">
<param name="strategyName" value="ChangeSingleTripMode"/>
<param name="weight" value="0.15"/>
<param name="subpopulation" value="person"/>
</parameterset>
<parameterset type="strategysettings">
<param name="strategyName" value="TimeAllocationMutator"/>
<param name="weight" value="0.05"/>
<param name="subpopulation" value="person"/>
</parameterset>
</module>
<module name="TimeAllocationMutator">
<param name="mutationRange" value="7200.0"/>
<param name="mutationAffectsDuration" value="false"/>
</module>
<module name="changeMode">
<!-- provide a comma-separated list of leg modes -->
<param name="modes" value="car,pt,bike,walk" />
<param name="ignoreCarAvailability" value="false" />
</module>
</config>
Binary file added scenarios/velbert-v1.1-10pct/velbert-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/velbert/VelbertApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected Config prepareConfig(Config config) {

for (long ii = 600; ii <= 97200; ii += 600) {

for (String act : List.of("business", "educ_higher", "educ_kiga", "educ_other", "educ_primary", "exuc_secondary",
for (String act : List.of("business", "educ_higher", "educ_kiga", "educ_other", "educ_primary", "educ_secondary",
"educ_tertiary", "errands", "home", "leasure", "shop_daily", "shop_other", "visit", "word")) {
config.planCalcScore()
.addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams(act + "_" + ii + ".0").setTypicalDuration(ii));
Expand Down

0 comments on commit 824cb78

Please sign in to comment.