Skip to content

Commit

Permalink
Fix SharedRoboTaxiTest. See also #330.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Oct 10, 2019
1 parent e38caa1 commit 73afb7c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
6 changes: 2 additions & 4 deletions resources/testScenario/config_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
<param name="infoLinePeriod" value="3600" />
</parameterset>



<parameterset type="timing">
<param name="pickupDurationPerStop" value="15.0" />
<param name="pickupDurationPerPassenger" value="15.0" />
<param name="pickupDurationPerPassenger" value="0.0" />
<param name="dropoffDurationPerStop" value="10.0" />
<param name="dropoffDurationPerPassenger" value="15.0" />
<param name="dropoffDurationPerPassenger" value="0.0" />
</parameterset>

<parameterset type="pricing">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void testAnalysis() throws Exception {
Scalar distanceRatio = Mean.of(ate.getDistancElement().ratios).Get(1);

//
scalarAssert.add(RationalScalar.of(180653, 2160000), occupancyRatio);
scalarAssert.add(RealScalar.of(0.6814775194509531), distanceRatio);
scalarAssert.add(RationalScalar.of(88841, 1080000), occupancyRatio);
scalarAssert.add(RealScalar.of(0.6821350810781722), distanceRatio);

/** fleet distances */
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistance));
Expand All @@ -165,11 +165,11 @@ public void testAnalysis() throws Exception {
assertTrue(((Scalar) Total.of(ate.getDistancElement().totalDistancesPerVehicle)).equals( //
ate.getDistancElement().totalDistance));

scalarAssert.add(RealScalar.of(34367.02346336422), ate.getDistancElement().totalDistance);
scalarAssert.add(RealScalar.of(28853.759188309727), ate.getDistancElement().totalDistanceWtCst);
scalarAssert.add(RealScalar.of(5513.264275054483), ate.getDistancElement().totalDistancePicku);
scalarAssert.add(RealScalar.of(34340.8378609224), ate.getDistancElement().totalDistance);
scalarAssert.add(RealScalar.of(28852.335921176378), ate.getDistancElement().totalDistanceWtCst);
scalarAssert.add(RealScalar.of(5488.501939745962), ate.getDistancElement().totalDistancePicku);
scalarAssert.add(RealScalar.of(0.0), ate.getDistancElement().totalDistanceRebal);
scalarAssert.add(RealScalar.of(0.8395769048509041), ate.getDistancElement().totalDistanceRatio);
scalarAssert.add(RealScalar.of(0.8401756543630645), ate.getDistancElement().totalDistanceRatio);

scalarAssert.add((Scalar) Total.of(ate.getDistancElement().totalDistancesPerVehicle), //
ate.getDistancElement().totalDistance);
Expand All @@ -188,10 +188,10 @@ public void testAnalysis() throws Exception {
ate.getTravelTimeAnalysis().getWaitAggrgte().get(0).Get(2)));
assertTrue(Scalars.lessEquals(Quantity.of(0, SI.SECOND), ate.getTravelTimeAnalysis().getWaitAggrgte().Get(1)));

scalarAssert.add(Quantity.of(284.01620253164555, SI.SECOND), ate.getTravelTimeAnalysis().getWaitAggrgte().Get(1));
scalarAssert.add(Quantity.of(282.95291139240504, SI.SECOND), ate.getTravelTimeAnalysis().getWaitAggrgte().Get(1));
scalarAssert.add(Quantity.of(3297.0, SI.SECOND), ate.getTravelTimeAnalysis().getWaitAggrgte().Get(2));
scalarAssert.add(Quantity.of(RationalScalar.of(361306, 395), SI.SECOND), ate.getTravelTimeAnalysis().getDrveAggrgte().Get(1));
scalarAssert.add(Quantity.of(4100, SI.SECOND), ate.getTravelTimeAnalysis().getDrveAggrgte().Get(2));
scalarAssert.add(Quantity.of(RationalScalar.of(355364, 395), SI.SECOND), ate.getTravelTimeAnalysis().getDrveAggrgte().Get(1));
scalarAssert.add(Quantity.of(4080, SI.SECOND), ate.getTravelTimeAnalysis().getDrveAggrgte().Get(2));

/* TODO Have a look at {AmodeusModule::install}. At some point the travel time calculation in DVRP has been improved.
* Unfortunately, this improvement breaks these tests.
Expand Down
19 changes: 9 additions & 10 deletions src/test/java/ch/ethz/idsc/amodeus/test/SharedRoboTaxiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void testAnalysis() throws Exception {

AnalysisTestExport ate = testServer.getAnalysisTestExport();

/** number of processed requests */
assertEquals(2000, ate.getSimulationInformationElement().reqsize());
/** number of processed requests, 25 of the population are same-link trips that are not passed on to Amodeus */
assertEquals(1975, ate.getSimulationInformationElement().reqsize());

/** fleet size */
assertEquals(200, ate.getSimulationInformationElement().vehicleSize());
Expand All @@ -133,20 +133,20 @@ public void testAnalysis() throws Exception {
Scalar distanceRatio = Mean.of(ate.getDistancElement().ratios).Get(1);

ScalarAssert scalarAssert = new ScalarAssert();
scalarAssert.add(RationalScalar.of(16597, 80000), occupancyRatio);
scalarAssert.add(RealScalar.of(0.32847508641744216), distanceRatio);
scalarAssert.add(RationalScalar.of(55283, 270000), occupancyRatio);
scalarAssert.add(RealScalar.of(0.3238083237367852), distanceRatio);

/** fleet distances */
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistance));
scalarAssert.add(RealScalar.of(259171.65846920596), ate.getDistancElement().totalDistance);
scalarAssert.add(RealScalar.of(259664.26958803422), ate.getDistancElement().totalDistance);
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistanceWtCst));
scalarAssert.add(RealScalar.of(84529.76856761157), ate.getDistancElement().totalDistanceWtCst);
scalarAssert.add(RealScalar.of(83394.96003773586), ate.getDistancElement().totalDistanceWtCst);
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistancePicku));
scalarAssert.add(RealScalar.of(10424.606654079673), ate.getDistancElement().totalDistancePicku);
scalarAssert.add(RealScalar.of(9933.196788780248), ate.getDistancElement().totalDistancePicku);
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistanceRebal));
scalarAssert.add(RealScalar.of(164217.2832475133), ate.getDistancElement().totalDistanceRebal);
scalarAssert.add(RealScalar.of(166336.11276151682), ate.getDistancElement().totalDistanceRebal);
assertTrue(Scalars.lessEquals(RealScalar.ZERO, ate.getDistancElement().totalDistanceRatio));
scalarAssert.add(RealScalar.of(0.32615359668138694), ate.getDistancElement().totalDistanceRatio);
scalarAssert.add(RealScalar.of(0.3211645567179676), ate.getDistancElement().totalDistanceRatio);
scalarAssert.consolidate();

ate.getDistancElement().totalDistancesPerVehicle.flatten(-1).forEach(s -> //
Expand Down Expand Up @@ -186,7 +186,6 @@ public void testAnalysis() throws Exception {
assertTrue(new File(data, "DistanceRatios").isDirectory());
assertTrue(new File(data, "DistanceRatios/DistanceRatios.mathematica").exists());
assertTrue(new File("output/001/report/report.html").exists());
assertTrue(new File("output/001/report/av.xml").exists());
assertTrue(new File("output/001/report/config.xml").exists());
}

Expand Down

0 comments on commit 73afb7c

Please sign in to comment.