From 73afb7cec01272470384f2180a80a929b78b1460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Thu, 10 Oct 2019 02:42:52 +0200 Subject: [PATCH] Fix SharedRoboTaxiTest. See also #330. --- resources/testScenario/config_full.xml | 6 ++---- .../amodeus/test/ScenarioPipeLineTest.java | 18 +++++++++--------- .../idsc/amodeus/test/SharedRoboTaxiTest.java | 19 +++++++++---------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/resources/testScenario/config_full.xml b/resources/testScenario/config_full.xml index 123dd504..198330f7 100644 --- a/resources/testScenario/config_full.xml +++ b/resources/testScenario/config_full.xml @@ -17,13 +17,11 @@ - - - + - + diff --git a/src/test/java/ch/ethz/idsc/amodeus/test/ScenarioPipeLineTest.java b/src/test/java/ch/ethz/idsc/amodeus/test/ScenarioPipeLineTest.java index 15c47695..3f0416e8 100644 --- a/src/test/java/ch/ethz/idsc/amodeus/test/ScenarioPipeLineTest.java +++ b/src/test/java/ch/ethz/idsc/amodeus/test/ScenarioPipeLineTest.java @@ -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)); @@ -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); @@ -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. diff --git a/src/test/java/ch/ethz/idsc/amodeus/test/SharedRoboTaxiTest.java b/src/test/java/ch/ethz/idsc/amodeus/test/SharedRoboTaxiTest.java index 07b53a20..a75db41e 100644 --- a/src/test/java/ch/ethz/idsc/amodeus/test/SharedRoboTaxiTest.java +++ b/src/test/java/ch/ethz/idsc/amodeus/test/SharedRoboTaxiTest.java @@ -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()); @@ -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 -> // @@ -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()); }