Skip to content

Commit

Permalink
update matsim and how the pt schedule is created
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Dec 5, 2024
1 parent f488192 commit df66c8f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 35 deletions.
21 changes: 16 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@

All notable changes to this project will be documented in this file.

### 6.4 (WIP)
### 6.4 (2024-12)
- Improved facility locations
- OSM tag filtering has been improved to reduce number of wrongly assigned facility types
- Update work location assignment within Berlin
- Work locations now use weighted sampling during location choice
- The weight is based on an attraction factor and zone specific probabilities determined from survey data
- Update GTFS schedule
- TODO
- New dashboard
- PT Transit viewer
- Updated GTFS schedule
- The schedule is now based on the 2024-11-19
- Note that there are major changes how stops and links between them are created
- Stops having the same gtfs parent_id and route types are merged together, allowing agents to find better PT connections
- The PT network is created with loop links (on each PT stop) instead of duplicating stops, which also improves connections
- Bike mode updated and recalibrated
- Bike is now routed on the network, which provides better travel times
- Bikes are not simulated on the network, and no link events generated yet. This will likely be added in future versions.
- The road network includes bike infrastructure and corresponding attributes
- The bike infrastructure is not fully complete yet, and has to be carefully evaluated first for bike centric studies
- The avg. bike speed has been set to match Srv2018 survey data
- New dashboards
- PT Transit viewer
- Emissions
- Noise

### 6.3 (2024-07)
- Include additional trip analysis and updated dashboard
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ $p/berlin-$V-network-with-pt.xml.gz: $p/berlin-$V-network.xml.gz
--transform-stops org.matsim.prepare.pt.CorrectStopLocations\
--transform-routes org.matsim.prepare.pt.CorrectRouteTypes\
--transform-schedule org.matsim.application.prepare.pt.AdjustSameDepartureTimes\
--pseudo-network withLoopLinks\
--merge-stops mergeToParentAndRouteTypes\
--shp $p/pt-area/pt-area.shp

$p/berlin-$V-counts-vmz.xml.gz: $p/berlin-$V-network.xml.gz
Expand Down
2 changes: 1 addition & 1 deletion input/v6.4/berlin-v6.4-vehicleTypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- The speed was set such that the obtained avg. speed per trip matches the one reported in the SrV survey -->
<!-- Note that this speed includes all the effects of delays that might occur, such as waiting for traffic lights -->
<!-- The reported data is 10.29 km/h, it needs to set higher here (+0.4) because this includes access/egress as well -->
<maximumVelocity meterPerSecond="2.972"/>
<maximumVelocity meterPerSecond="2.98"/>
<passengerCarEquivalents pce="0.2"/>
<networkMode networkMode="bike"/>
</vehicleType>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>matsim-all</artifactId>

<!-- PR-labelled release -->
<version>2025.0-PR3552</version>
<version>2025.0-PR3628</version>

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<!-- <version>2025.0-SNAPSHOT</version>-->
Expand Down Expand Up @@ -128,7 +128,7 @@
<dependency>
<groupId>com.github.matsim-org</groupId>
<artifactId>gtfs2matsim</artifactId>
<version>47b0802a29</version>
<version>19f1676fc6</version>
<exclusions>
<exclusion>
<groupId>org.matsim</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
*/
package org.matsim.legacy.prepare.transit.schedule;

import java.io.File;
import java.time.LocalDate;
import java.util.List;

import ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorModule;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.Node;
import org.matsim.contrib.gtfs.GtfsConverter;
import org.matsim.contrib.gtfs.RunGTFS2MATSim;
import org.matsim.contrib.gtfs.TransitSchedulePostProcessTools;
import org.matsim.core.config.Config;
Expand All @@ -48,27 +46,19 @@
import org.matsim.core.network.io.NetworkWriter;
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.transformations.IdentityTransformation;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.legacy.prepare.transit.schedule.CheckPtDelays.DelayRecord;
import org.matsim.pt.transitSchedule.api.Departure;
import org.matsim.pt.transitSchedule.api.TransitLine;
import org.matsim.pt.transitSchedule.api.TransitRoute;
import org.matsim.pt.transitSchedule.api.TransitRouteStop;
import org.matsim.pt.transitSchedule.api.TransitSchedule;
import org.matsim.pt.transitSchedule.api.TransitScheduleReader;
import org.matsim.pt.transitSchedule.api.TransitScheduleWriter;
import org.matsim.pt.transitSchedule.api.*;
import org.matsim.pt.utils.CreatePseudoNetwork;
import org.matsim.pt.utils.TransitScheduleValidator;
import org.matsim.pt.utils.TransitScheduleValidator.ValidationResult;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleCapacity;
import org.matsim.vehicles.VehicleType;
import org.matsim.vehicles.MatsimVehicleWriter;
import org.matsim.vehicles.VehiclesFactory;
import org.matsim.vehicles.*;
import org.matsim.vehicles.VehicleType.DoorOperationMode;
import org.matsim.vehicles.VehicleUtils;

import ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorModule;
import java.io.File;
import java.time.LocalDate;
import java.util.List;

/**
* @author vsp-gleich
Expand All @@ -80,7 +70,7 @@
* TODO: Theoretically we would have to increase the boarding/alighting time and reduce the capacity of the transit vehicle types
* according to the sample size.
*/

@Deprecated
public class RunGTFS2MATSimOpenBerlin {

private static final Logger log = LogManager.getLogger(RunGTFS2MATSimOpenBerlin.class);
Expand Down Expand Up @@ -113,7 +103,8 @@ public static void main(String[] args) {
}

//Convert GTFS
RunGTFS2MATSim.convertGtfs(gtfsZipFile, scheduleFile, date, ct, false);
RunGTFS2MATSim.convertGtfs(gtfsZipFile, scheduleFile, date, date, new IdentityTransformation(),
false, GtfsConverter.MergeGtfsStops.doNotMerge);

//Parse the schedule again
Scenario scenario = ScenarioUtils.createScenario(ConfigUtils.createConfig());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ private static void defineCarriersChessboard(Carriers carriers, CarrierVehicle v
carrierChessboard.setCarrierCapabilities(carrierCapabilities);

// Fahrzeugtypen den Anbietern zuordenen
new CarrierVehicleTypeLoader(carriers).loadVehicleTypes(carrierVehicleTypes);
// new CarrierVehicleTypeLoader(carriers).loadVehicleTypes(carrierVehicleTypes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.freight.carriers.*;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.controler.CarrierModule;
import org.matsim.freight.carriers.jsprit.MatsimJspritFactory;
import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts;
import org.matsim.freight.carriers.jsprit.NetworkRouter;
Expand Down Expand Up @@ -604,8 +603,8 @@ static void solveWithJsprit(Scenario scenario, Carriers carriers, HashMap<String
scenario.getConfig().controller().getOutputDirectory() + "/jsprit_CarrierPlans_Test01.png",
"bestSolution");
}
new CarrierPlanXmlWriterV2(carriers)
.write(scenario.getConfig().controller().getOutputDirectory() + "/jsprit_CarrierPlans.xml");
// new CarrierPlanXmlWriterV2(carriers)
// .write(scenario.getConfig().controller().getOutputDirectory() + "/jsprit_CarrierPlans.xml");

}

Expand All @@ -625,7 +624,7 @@ static void solveWithJsprit(Scenario scenario, Carriers carriers, HashMap<String
static Controler prepareControler(Scenario scenario) {
Controler controler = new Controler(scenario);

controler.addOverridingModule( new CarrierModule() );
// controler.addOverridingModule( new CarrierModule() );

controler.addOverridingModule(new AbstractModule() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public static void main(String[] args) throws Exception {

controler.run();

new CarrierPlanXmlWriterV2(carriers)
.write(scenario.getConfig().controller().getOutputDirectory() + "/output_CarrierPlans.xml");
// new CarrierPlanXmlWriterV2(carriers)
// .write(scenario.getConfig().controller().getOutputDirectory() + "/output_CarrierPlans.xml");

AbfallUtils.outputSummary(districtsWithGarbage, scenario, carrierMap, day, volumeDustbinInLiters,
secondsServiceTimePerDustbin);
Expand Down

0 comments on commit df66c8f

Please sign in to comment.