Skip to content

Commit

Permalink
make pt fares module work and update of matsim-libs for pt fares.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsp-gleich committed Aug 28, 2024
1 parent dd5d3f3 commit e57d923
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.matsim</groupId>
<artifactId>matsim-all</artifactId>
<version>2025.0-PR3411</version>
<version>2025.0-PR3434</version>
<!-- <version>16.0-SNAPSHOT</version>-->
</parent>

Expand Down
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]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.38.1-Grenoble">
<identifier></identifier>
<parentidentifier></parentidentifier>
<language></language>
<type>dataset</type>
<title></title>
<abstract></abstract>
<contact>
<name></name>
<organization></organization>
<position></position>
<voice></voice>
<fax></fax>
<email></email>
<role></role>
</contact>
<links/>
<dates/>
<fees></fees>
<encoding></encoding>
<crs>
<spatialrefsys nativeFormat="Wkt">
<wkt></wkt>
<proj4>+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs</proj4>
<srsid>0</srsid>
<srid>0</srid>
<authid></authid>
<description></description>
<projectionacronym></projectionacronym>
<ellipsoidacronym></ellipsoidacronym>
<geographicflag>false</geographicflag>
</spatialrefsys>
</crs>
<extent>
<spatial minz="0" maxy="0" minx="0" maxz="0" crs="" dimensions="2" miny="0" maxx="0"/>
<temporal>
<period>
<start></start>
<end></end>
</period>
</temporal>
</extent>
</qgis>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public Integer call() {
log.warn("Small-scale Commercial demand already exists. Skipping generation.");
} else {
//TODO check: Wo wird das Volumen der existierenden Modelle von den erzeugten Potentialen abgezogen?
new GenerateSmallScaleCommercialTrafficDemand(integrateExistingTrafficToSmallScaleCommercial).execute(
new GenerateSmallScaleCommercialTrafficDemand(integrateExistingTrafficToSmallScaleCommercial, null).execute(
configPath.toString(),
"--pathToDataDistributionToZones", pathDataDistributionFile.toString(),
"--pathToCommercialFacilities", configPath.getParent().relativize(pathCommercialFacilities).toString(),
Expand Down
29 changes: 14 additions & 15 deletions src/main/java/org/matsim/run/MetropoleRuhrScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.inject.Singleton;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.locationtech.jts.util.Assert;
import org.matsim.analysis.ModeChoiceCoverageControlerListener;
import org.matsim.analysis.TripMatrix;
import org.matsim.analysis.personMoney.PersonMoneyEventsAnalysisModule;
Expand All @@ -38,6 +37,7 @@
import org.matsim.application.options.SampleOptions;
import org.matsim.contrib.bicycle.BicycleConfigGroup;
import org.matsim.contrib.bicycle.BicycleModule;
import org.matsim.contrib.vsp.pt.fare.PtFareModule;
import org.matsim.contrib.vsp.scenario.SnzActivities;
import org.matsim.contrib.vsp.scoring.RideScoringParamsFromCarParams;
import org.matsim.core.config.Config;
Expand All @@ -62,9 +62,9 @@
import org.matsim.simwrapper.SimWrapperModule;
import org.matsim.vehicles.VehicleType;
import picocli.CommandLine;
import playground.vsp.pt.fare.DistanceBasedPtFareParams;
import playground.vsp.pt.fare.FareZoneBasedPtFareParams;
import playground.vsp.pt.fare.PtFareConfigGroup;
import org.matsim.contrib.vsp.pt.fare.DistanceBasedPtFareParams;
import org.matsim.contrib.vsp.pt.fare.FareZoneBasedPtFareParams;
import org.matsim.contrib.vsp.pt.fare.PtFareConfigGroup;
import playground.vsp.scoring.IncomeDependentUtilityOfMoneyPersonScoringParameters;
import playground.vsp.simpleParkingCostHandler.ParkingCostConfigGroup;
import playground.vsp.simpleParkingCostHandler.ParkingCostModule;
Expand Down Expand Up @@ -291,25 +291,22 @@ private static void preparePtFareConfig(Config config) {

// inside of RVR use the RVR Tarif
FareZoneBasedPtFareParams rvr = new FareZoneBasedPtFareParams();
rvr.setTransactionPartner("RVR Tarif");
rvr.setDescription("RVR Tarif");
rvr.setFareZoneShp("./pt-pricing/pt_preisstufen.shp");
rvr.setTransactionPartner("VRR");
rvr.setDescription("VRR Tarifstufe A");
rvr.setFareZoneShp("./pt-pricing/pt_preisstufen_fare_all3.0.shp");
rvr.setOrder(1);

// outside of RVR use the eezyVRR Tarif 1,50 EUR + 0.25 * Luftlinien-km.
DistanceBasedPtFareParams eezy = new DistanceBasedPtFareParams();
eezy.setTransactionPartner("eezyVRR");
eezy.setDescription("eezyVRR");
eezy.setFareZoneShp("./nrwArea/dvg2bld.shp");
eezy.setNormalTripIntercept(1.5);
eezy.setNormalTripSlope(0.25);
//due to high threshold not used, but for security the same as normal
eezy.setLongDistanceTripIntercept(1.5);
eezy.setLongDistanceTripSlope(0.25);
eezy.setLongDistanceTripThreshold(1000000);
eezy.setFareZoneShp("./nrwArea/dvg2bld_nw.shp");
DistanceBasedPtFareParams.DistanceClassLinearFareFunctionParams eezyFareFunction = eezy.getOrCreateDistanceClassFareParams(Double.POSITIVE_INFINITY);
eezyFareFunction.setFareIntercept(1.5);
eezyFareFunction.setFareSlope(0.00025);
eezy.setOrder(2);

DistanceBasedPtFareParams germany = DistanceBasedPtFareParams.GERMAN_WIDE_FARE;
DistanceBasedPtFareParams germany = DistanceBasedPtFareParams.GERMAN_WIDE_FARE_2024;
germany.setTransactionPartner("Deutschlandtarif");
germany.setDescription("Deutschlandtarif");
germany.setOrder(3);
Expand Down Expand Up @@ -351,6 +348,8 @@ protected void prepareControler(Controler controler) {
//controler.addOverridingModule(new LinkPaxVolumesAnalysisModule());
controler.addOverridingModule(new PtStop2StopAnalysisModule());

controler.addOverridingModule(new PtFareModule());

controler.addOverridingModule(new AbstractModule() {
@Override
public void install() {
Expand Down

0 comments on commit e57d923

Please sign in to comment.