Skip to content

Commit

Permalink
Merge branch '6.x' into 6.x-next
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
rakow committed Apr 17, 2024
2 parents 39e0763 + f5f599c commit d991e1d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
All notable changes to this project will be documented in this file.


### 6.1 (2024-03-26)
### 6.1 (2024-04-17)

- Trips from survey data are filtered slightly different
- Previously trips that did not have the flag `E_WEG_GUELTIG`, where filtered out.
- Previously, trips that did not have the flag `E_WEG_GUELTIG`, have been ignored.
- However, this flag is not considered in SrV reports, or the Berlin website that reports the modal share.
- To be more in line with these reports, these trips are now not filtered as well.
- This leads to slightly different mode shares from the previous version.
- To be more consistent with these reports, these trips are now considered as well.
- This leads to slightly different mode shares compared to the previous version.

- Commercial traffic was updated to include recent changes
- Temporal distribution was updated according to survey data
Expand Down
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,21 @@ $p/berlin-$V-25pct.plans-initial.xml.gz: $p/berlin-$V-facilities.xml.gz $p/berli
--sample-size 0.25\
--samples 0.1 0.03 0.01 0.001\

$p/berlin-$V-25pct.plans.xml.gz:
$p/berlin-$V-10pct.plans.xml.gz:
$(sc) prepare clean-population\
--plans mode-choice-10pct/runs/004/004.output_plans.xml.gz\
--remove-unselected-plans\
--output mode-choice-final/runs/004/berlin-$V-10pct.plans.xml.gz

$(sc) prepare clean-population\
--plans mode-choice-final-25pct/runs/004/004.output_plans.xml.gz\
--plans mode-choice-10pct-default-v2/runs/008/008.output_plans.xml.gz\
--remove-unselected-plans\
--output $@

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

prepare-calibration: $p/berlin-cadyts-input-$V-25pct.plans.xml.gz $p/berlin-$V-network-with-pt.xml.gz $p/berlin-$V-counts-vmz.xml.gz
echo "Done"

prepare-initial: $p/berlin-$V-25pct.plans-initial.xml.gz $p/berlin-$V-network-with-pt.xml.gz
echo "Done"

prepare: $p/berlin-$V-25pct.plans.xml.gz
prepare: $p/berlin-$V-10pct.plans.xml.gz
echo "Done"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository provides an open MATSim transport model for Berlin, provided by

Currently, there are multiple versions of the MATSim Open Berlin model:

### 10pct scenario (`input/v6.0`)
### 10pct scenario (`input/v6.1`)

This scenario contains both 10pct and 1pct sample of the Greater Berlin population; road capacities are accordingly reduced. The scenario is calibrated taking into consideration the traffic counts, modal split and mode-specific trip distance distributions.

Expand All @@ -38,14 +38,14 @@ Handling of large files within git is not without problems (git lfs files are no

1. Open SimWrapper at https://simwrapper.github.io/site/ .
1. Select Explore Data Sources -> VSP Public-SVN .
1. Navigate to de -> berlin -> berlin-v6.0 (https://simwrapper.github.io/site/public/de/berlin/berlin-v6.0).
1. Navigate to de -> berlin -> berlin-v6.1 (https://simwrapper.github.io/site/public/de/berlin/berlin-v6.1).
1. Enjoy the dashboards and visualizations.

### Run VIA on output files

1. Get VIA from https://www.simunto.com/via/. (There is a free license for a small number of agents; that will probably work but only display a small number of vehicles/agents.)
1. Go to https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/ .
1. Decide for a scenario that you find interesting (e.g. `berlin-v6.0`) and go into that directory.
1. Decide for a scenario that you find interesting (e.g. `berlin-v6.1`) and go into that directory.
1. Inside there, look for an `output-*` directory that you find interesting and go into that directory.
1. Download `*.output_network.xml.gz` and `*.output_events.xml.gz`. Best make sure that they do not uncompress, e.g. by "Download linked file as ...".
1. Get these files into VIA. This can be achieved in various ways; one is to open VIA and then drag the files from a file browser into VIA.
Expand Down
12 changes: 6 additions & 6 deletions input/v6.1/berlin-v6.1.config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
<param name="numberOfThreads" value="16"/>
</module>
<module name="network">
<param name="inputNetworkFile" value="./berlin-v6.1-network-with-pt.xml.gz"/>
<param name="inputNetworkFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-network-with-pt.xml.gz"/>
</module>
<module name="plans">
<param name="inputPlansFile" value="./berlin-v6.1-25pct.plans-initial.xml.gz"/>
<param name="inputPlansFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-10pct.plans.xml.gz"/>
<param name="removingUnnecessaryPlanAttributes" value="true"/>
</module>
<module name="vehicles">
<param name="vehiclesFile"
value="./berlin-v6.1-vehicleTypes.xml"/>
</module>
<module name="transit">
<param name="transitScheduleFile" value="./berlin-v6.1-transitSchedule.xml.gz"/>
<param name="transitScheduleFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-transitSchedule.xml.gz"/>
<param name="useTransit" value="true"/>
<param name="vehiclesFile" value="./berlin-v6.1-transitVehicles.xml.gz"/>
<param name="vehiclesFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-transitVehicles.xml.gz"/>
</module>
<module name="facilities">
<param name="facilitiesSource" value="fromFile"/>
<param name="inputFacilitiesFile" value="./berlin-v6.1-facilities.xml.gz"/>
<param name="inputFacilitiesFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-facilities.xml.gz"/>
</module>
<module name="routing">
<param name="networkModes" value="car,truck,freight,ride"/>
Expand Down Expand Up @@ -186,7 +186,7 @@
</module>

<module name="counts">
<param name="inputCountsFile" value="./berlin-v6.1-counts-vmz.xml.gz"/>
<param name="inputCountsFile" value="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v6.1/input/berlin-v6.1-counts-vmz.xml.gz"/>
<param name="countsScaleFactor" value="0.1"/>
</module>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public final class PiecewiseLinearlLegScoring implements org.matsim.core.scoring
/**
* The parameters used for scoring.
*/
protected final ScoringParameters params;
private final ScoringParameters params;
private final Set<String> ptModes;
private final double marginalUtilityOfMoney;
protected double score;
protected Network network;
private final Set<String> modesAlreadyConsideredForDailyConstants;
private double score;
private Network network;
private boolean nextEnterVehicleIsFirstOfTrip = true;
private boolean nextStartPtLegIsFirstOfTrip = true;
private boolean currentLegIsPtLeg = false;
private double lastActivityEndTime = Double.NaN;
private final Set<String> modesAlreadyConsideredForDailyConstants;

public PiecewiseLinearlLegScoring(final ScoringParameters params, Network network, Set<String> ptModes) {
this.params = params;
Expand All @@ -83,15 +83,14 @@ public double getScore() {
/**
* Calculate the score for a leg.
*/
protected double calcLegScore(final double departureTime, final double arrivalTime, final Leg leg) {
private double calcLegScore(final double departureTime, final double arrivalTime, final Leg leg) {
double tmpScore = 0.0;
// travel time in seconds
double travelTime = arrivalTime - departureTime;
ModeUtilityParameters modeParams = this.params.modeParams.get(leg.getMode());

if (modeParams == null) {
if (leg.getMode().equals(TransportMode.transit_walk) || leg.getMode().equals(TransportMode.non_network_walk)
|| leg.getMode().equals(TransportMode.non_network_walk)) {
if (leg.getMode().equals(TransportMode.transit_walk) || leg.getMode().equals(TransportMode.non_network_walk)) {
modeParams = this.params.modeParams.get(TransportMode.walk);
} else {
// modeParams = this.params.modeParams.get(TransportMode.other);
Expand Down Expand Up @@ -139,14 +138,14 @@ protected double calcLegScore(final double departureTime, final double arrivalTi
Route route = leg.getRoute();
// distance in meters
double dist = route.getDistance();
if ( Double.isNaN(dist) ) {
if ( ccc<10 ) {
ccc++ ;
if (Double.isNaN(dist)) {
if (ccc < 10) {
ccc++;
LogManager.getLogger(this.getClass()).warn("distance is NaN. Will make score of this plan NaN. Possible reason: Simulation does not report " +
"a distance for this trip. Possible reason for that: mode is teleported and router does not " +
"write distance into plan. Needs to be fixed or these plans will die out.") ;
if ( ccc==10 ) {
LogManager.getLogger(this.getClass()).warn(Gbl.FUTURE_SUPPRESSED) ;
"write distance into plan. Needs to be fixed or these plans will die out.");
if (ccc == 10) {
LogManager.getLogger(this.getClass()).warn(Gbl.FUTURE_SUPPRESSED);
}
}
}
Expand Down

0 comments on commit d991e1d

Please sign in to comment.