From 3214a66ee57036339a9c1c901f06e4eda612ab96 Mon Sep 17 00:00:00 2001 From: Laura Bieker-Walz Date: Wed, 21 Feb 2018 15:28:31 +0100 Subject: [PATCH] tests for the bluelight device, refs #1967 --- src/microsim/devices/MSDevice_Bluelight.cpp | 5 +- .../extended/device_bluelight/errors.sumo | 0 .../device_bluelight/input_routes.rou.xml | 14 + .../extended/device_bluelight/net2.net.xml | 251 ++++++++++++++++++ .../extended/device_bluelight/options.sumo | 1 + .../extended/device_bluelight/output.sumo | 29 ++ .../extended/device_bluelight/tripinfos.sumo | 46 ++++ tests/sumo/extended/testsuite.sumo | 3 + 8 files changed, 347 insertions(+), 2 deletions(-) create mode 100644 tests/sumo/extended/device_bluelight/errors.sumo create mode 100644 tests/sumo/extended/device_bluelight/input_routes.rou.xml create mode 100644 tests/sumo/extended/device_bluelight/net2.net.xml create mode 100644 tests/sumo/extended/device_bluelight/options.sumo create mode 100644 tests/sumo/extended/device_bluelight/output.sumo create mode 100644 tests/sumo/extended/device_bluelight/tripinfos.sumo diff --git a/src/microsim/devices/MSDevice_Bluelight.cpp b/src/microsim/devices/MSDevice_Bluelight.cpp index 1a3a1d26d066..00a2f85602fe 100644 --- a/src/microsim/devices/MSDevice_Bluelight.cpp +++ b/src/microsim/devices/MSDevice_Bluelight.cpp @@ -149,14 +149,15 @@ MSDevice_Bluelight::notifyMove(SUMOVehicle& veh, double /* oldPos */, //Setting the lateral alignment to build a rescue lane if (veh2->getLane()->getIndex() == numLanes-1) { t.setPreferredLateralAlignment(LATALIGN_LEFT); - //std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; + //std::cout << "New alignment to left for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; } else { t.setPreferredLateralAlignment(LATALIGN_RIGHT); - //std::cout << "New alignment to left for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; + //std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; } //influencedVehicles->push_back(static_cast(veh2)); //std::cout << "Vehcile in influencedVehicleList: " << veh2->getID() << "\n"; } + //todo if vehicle is passed all vehicles which had to react should get their state back after they leave the communication range } } return true; // keep the device diff --git a/tests/sumo/extended/device_bluelight/errors.sumo b/tests/sumo/extended/device_bluelight/errors.sumo new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/sumo/extended/device_bluelight/input_routes.rou.xml b/tests/sumo/extended/device_bluelight/input_routes.rou.xml new file mode 100644 index 000000000000..d83eb50811f6 --- /dev/null +++ b/tests/sumo/extended/device_bluelight/input_routes.rou.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/sumo/extended/device_bluelight/net2.net.xml b/tests/sumo/extended/device_bluelight/net2.net.xml new file mode 100644 index 000000000000..ef5aa6fc5cc5 --- /dev/null +++ b/tests/sumo/extended/device_bluelight/net2.net.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/sumo/extended/device_bluelight/options.sumo b/tests/sumo/extended/device_bluelight/options.sumo new file mode 100644 index 000000000000..c6d72a83d08c --- /dev/null +++ b/tests/sumo/extended/device_bluelight/options.sumo @@ -0,0 +1 @@ +--no-step-log --no-duration-log --net-file=net2.net.xml -r input_routes.rou.xml --device.bluelight.explicit rescue --tripinfo-output tripinfos.xml --lateral-resolution 0.64 diff --git a/tests/sumo/extended/device_bluelight/output.sumo b/tests/sumo/extended/device_bluelight/output.sumo new file mode 100644 index 000000000000..b56cf0c6bbba --- /dev/null +++ b/tests/sumo/extended/device_bluelight/output.sumo @@ -0,0 +1,29 @@ +vehicle 'rescue' does not supply vehicle parameter 'bluelight'. Using default of -1.00 +vehicle 'rescue' does not supply vType parameter 'bluelight'. Using default of -1.00 +initialized device 'bluelight_rescue' with myCustomValue1=0.00, myCustomValue2=-1.00, myCustomValue3=-1.00 +device 'bluelight_rescue' notifyEnter: reason=0 currentEdge=SC +device 'bluelight_rescue' notifyMove: newSpeed=2.60 +device 'bluelight_rescue' notifyMove: newSpeed=5.20 +device 'bluelight_rescue' notifyMove: newSpeed=7.80 +device 'bluelight_rescue' notifyMove: newSpeed=10.40 +device 'bluelight_rescue' notifyMove: newSpeed=13.00 +device 'bluelight_rescue' notifyMove: newSpeed=15.60 +device 'bluelight_rescue' notifyMove: newSpeed=11.62 +device 'bluelight_rescue' notifyMove: newSpeed=7.12 +device 'bluelight_rescue' notifyMove: newSpeed=2.62 +device 'bluelight_rescue' notifyMove: newSpeed=5.22 +device 'bluelight_rescue' notifyLeave: reason=3 currentEdge=SC +device 'bluelight_rescue' notifyEnter: reason=3 currentEdge=SC +device 'bluelight_rescue' notifyMove: newSpeed=7.82 +device 'bluelight_rescue' notifyLeave: reason=1 currentEdge=SC +device 'bluelight_rescue' notifyEnter: reason=1 currentEdge=SC +device 'bluelight_rescue' notifyMove: newSpeed=10.42 +device 'bluelight_rescue' notifyLeave: reason=1 currentEdge=SC +device 'bluelight_rescue' notifyEnter: reason=1 currentEdge=CN +device 'bluelight_rescue' notifyMove: newSpeed=13.02 +device 'bluelight_rescue' notifyMove: newSpeed=15.62 +device 'bluelight_rescue' notifyMove: newSpeed=18.22 +device 'bluelight_rescue' notifyMove: newSpeed=20.82 +device 'bluelight_rescue' notifyMove: newSpeed=23.42 +device 'bluelight_rescue' notifyMove: newSpeed=26.02 +device 'bluelight_rescue' notifyLeave: reason=6 currentEdge=CN diff --git a/tests/sumo/extended/device_bluelight/tripinfos.sumo b/tests/sumo/extended/device_bluelight/tripinfos.sumo new file mode 100644 index 000000000000..a880ce542f6b --- /dev/null +++ b/tests/sumo/extended/device_bluelight/tripinfos.sumo @@ -0,0 +1,46 @@ + + + + + + + + + + + + + diff --git a/tests/sumo/extended/testsuite.sumo b/tests/sumo/extended/testsuite.sumo index a264528980e9..751d67282cfb 100644 --- a/tests/sumo/extended/testsuite.sumo +++ b/tests/sumo/extended/testsuite.sumo @@ -38,6 +38,9 @@ shapes # tests functions of the example device device_example +# tests functions of the bluelight device +device_bluelight + # saving and loading simulation state state