Skip to content

Commit

Permalink
adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel committed May 3, 2024
1 parent ca699ed commit 0d32d67
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.ev.EvConfigGroup;
Expand Down Expand Up @@ -56,16 +57,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 600.;
drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = true;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 1000.;
constraintsParam.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams;
Expand Down Expand Up @@ -45,16 +46,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 600.;
drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = true;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 1000.;
constraintsParam.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams;
Expand Down Expand Up @@ -46,16 +47,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 600.;
drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = true;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 1000.;
constraintsParam.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
40 changes: 22 additions & 18 deletions examples/scenarios/kelheim/config-with-drt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,17 @@
<parameterset type="ExtensiveInsertionSearch"/>
<!-- If true, the startLink is changed to last link in the current schedule, so the taxi starts the next day at the link where it stopped operating the day before. False by default. -->
<param name="changeStartLinkToLastLinkInSchedule" value="false"/>
<!-- Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Alpha should not be smaller than 1. -->
<param name="maxTravelTimeAlpha" value="1.5"/>
<!-- Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Beta should not be smaller than 0. -->
<param name="maxTravelTimeBeta" value="1200.0"/>
<!-- Max wait time for the bus to come (optimisation constraint). -->
<param name="maxWaitTime" value="1200.0"/>
<!-- Maximum walk distance to next stop location in stationbased system. -->
<param name="maxWalkDistance" value="1500.0"/>
<param name="rejectRequestIfMaxWaitOrTravelTimeViolated" value="false" />
<parameterset type="drtOptimizationConstraints">
<!-- Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Alpha should not be smaller than 1. -->
<param name="maxTravelTimeAlpha" value="1.5"/>
<!-- Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Beta should not be smaller than 0. -->
<param name="maxTravelTimeBeta" value="1200.0"/>
<!-- Max wait time for the bus to come (optimisation constraint). -->
<param name="maxWaitTime" value="1200.0"/>
<!-- Maximum walk distance to next stop location in stationbased system. -->
<param name="maxWalkDistance" value="1500.0"/>
<param name="rejectRequestIfMaxWaitOrTravelTimeViolated" value="false" />
</parameterset>
<!-- Operational Scheme, either door2door or stopbased. door2door by default -->
<param name="operationalScheme" value="stopbased"/>

Expand Down Expand Up @@ -286,15 +288,17 @@
<parameterset type="ExtensiveInsertionSearch"/>
<!-- If true, the startLink is changed to last link in the current schedule, so the taxi starts the next day at the link where it stopped operating the day before. False by default. -->
<param name="changeStartLinkToLastLinkInSchedule" value="false"/>
<!-- Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Alpha should not be smaller than 1. -->
<param name="maxTravelTimeAlpha" value="1.5"/>
<!-- Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Beta should not be smaller than 0. -->
<param name="maxTravelTimeBeta" value="1200.0"/>
<!-- Max wait time for the bus to come (optimisation constraint). -->
<param name="maxWaitTime" value="1200.0"/>
<!-- Maximum walk distance to next stop location in stationbased system. -->
<param name="maxWalkDistance" value="1500.0"/>
<param name="rejectRequestIfMaxWaitOrTravelTimeViolated" value="false" />
<parameterset type="drtOptimizationConstraints">
<!-- Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Alpha should not be smaller than 1. -->
<param name="maxTravelTimeAlpha" value="1.5"/>
<!-- Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. maxTravelTimeAlpha * estimated_drt_travel_time + maxTravelTimeBeta. Beta should not be smaller than 0. -->
<param name="maxTravelTimeBeta" value="1200.0"/>
<!-- Max wait time for the bus to come (optimisation constraint). -->
<param name="maxWaitTime" value="1200.0"/>
<!-- Maximum walk distance to next stop location in stationbased system. -->
<param name="maxWalkDistance" value="1500.0"/>
<param name="rejectRequestIfMaxWaitOrTravelTimeViolated" value="false" />
</parameterset>
<!-- Operational Scheme, either of door2door, stopbased or serviceAreaBased. door2door by default -->
<param name="operationalScheme" value="stopbased"/>

Expand Down
8 changes: 5 additions & 3 deletions examples/scenarios/mielec/mielec_drt_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
<parameterset type="drt">
<parameterset type="ExtensiveInsertionSearch"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>

<param name="vehiclesFile" value="vehicles-10-cap-4.xml"/>
<!-- param name="vehiclesFile" value="vehicles-20-cap-2.xml" / -->
Expand Down
7 changes: 5 additions & 2 deletions examples/scenarios/mielec/mielec_edrt_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
<parameterset type="ExtensiveInsertionSearch"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>

<param name="idleVehiclesReturnToDepots" value="true"/>
<param name="vehiclesFile" value="vehicles-10-cap-4.xml"/>
Expand Down
16 changes: 10 additions & 6 deletions examples/scenarios/mielec/mielec_multiModeEdrt_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<parameterset type="ExtensiveInsertionSearch"/>
<param name="mode" value="drt1"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>

<param name="idleVehiclesReturnToDepots" value="true"/>
<param name="vehiclesFile" value="vehicles-10-cap-4.xml"/>
Expand All @@ -40,9 +42,11 @@
<parameterset type="ExtensiveInsertionSearch"/>
<param name="mode" value="drt2"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>

<param name="idleVehiclesReturnToDepots" value="true"/>
<param name="vehiclesFile" value="vehicles-10-cap-4_drt2.xml"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
<parameterset type="drt">
<parameterset type="ExtensiveInsertionSearch"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>

<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>
<param name="operationalScheme" value="serviceAreaBased"/>
<param name="drtServiceAreaShapeFile" value="mielec/mielec.shp"/>

Expand Down
8 changes: 5 additions & 3 deletions examples/scenarios/mielec/mielec_stop_based_drt_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
<parameterset type="drt">
<parameterset type="ExtensiveInsertionSearch"/>
<param name="stopDuration" value="60"/>
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
<parameterset type="drtOptimizationConstraints">
<param name="maxWaitTime" value="600"/>
<param name="maxTravelTimeAlpha" value="1.3"/>
<param name="maxTravelTimeBeta" value="400"/>
</parameterset>

<!-- Maximum walk distance to next stop location in stationbased system. -->
<param name="maxWalkDistance" value="1500.0"/>
Expand Down

0 comments on commit 0d32d67

Please sign in to comment.