@@ -645,7 +645,6 @@ TEST_CASE("Dynamics") {
645645 graph2.buildAdj ();
646646 graph2.adjustNodeCapacities ();
647647 auto const & nodes = graph2.nodeSet ();
648- auto & tl = dynamic_cast <TrafficLight&>(*nodes.at (1 ));
649648 nodes.at (0 )->setCoords ({0 ., -1 .});
650649 nodes.at (2 )->setCoords ({0 ., 1 .});
651650 nodes.at (3 )->setCoords ({-1 ., 0 .});
@@ -715,7 +714,6 @@ TEST_CASE("Dynamics") {
715714 graph2.buildAdj ();
716715 graph2.adjustNodeCapacities ();
717716 auto const & nodes = graph2.nodeSet ();
718- auto & tl = dynamic_cast <TrafficLight&>(*nodes.at (1 ));
719717 nodes.at (0 )->setCoords ({0 ., -1 .});
720718 nodes.at (2 )->setCoords ({0 ., 1 .});
721719 nodes.at (3 )->setCoords ({-1 ., 0 .});
@@ -781,7 +779,6 @@ TEST_CASE("Dynamics") {
781779 Dynamics dynamics{graph2, 69 };
782780 std::vector<dsm::Id> destinationNodes{0 , 2 , 3 , 4 };
783781 dynamics.setDestinationNodes (destinationNodes);
784- auto const & cycles{tl.cycles ()};
785782 WHEN (" We evolve the dynamics and optimize traffic lights" ) {
786783 dynamics.addAgents (7 , 0 , 2 );
787784 dynamics.addAgents (7 , 2 , 0 );
@@ -923,7 +920,6 @@ TEST_CASE("Dynamics") {
923920 CHECK_EQ (dynamics.streetMeanSpeed (0.2 , true ).std , 0 .);
924921 CHECK_EQ (dynamics.streetMeanSpeed (0.2 , false ).mean , 15 .);
925922 CHECK_EQ (dynamics.streetMeanSpeed (0.2 , false ).std , 0 .);
926- (10 , 0 , 0 );
927923 dynamics.evolve (false );
928924 meanSpeed = 0 .;
929925 for (const auto & [agentId, agent] : dynamics.agents ()) {
@@ -940,19 +936,19 @@ TEST_CASE("Dynamics") {
940936 SUBCASE (" Intersection priorities" ) {
941937 GIVEN (" A dynamics object with five nodes and eight streets" ) {
942938 Graph graph2;
943- auto & nodeO = graph2.addNode <Intersection>(0 , std::make_pair (0 , 0 ));
944- auto & nodeA = graph2.addNode <Intersection>(1 , std::make_pair (-1 , 1 ));
945- auto & nodeB = graph2.addNode <Intersection>(2 , std::make_pair (1 , 1 ));
946- auto & nodeC = graph2.addNode <Intersection>(3 , std::make_pair (1 , -1 ));
947- auto & nodeD = graph2.addNode <Intersection>(4 , std::make_pair (-1 , -1 ));
948- auto & sOA = graph2.addEdge <Street>(0 , std::make_pair (0 , 1 ), 10 ., 10 .);
949- auto & sOB = graph2.addEdge <Street>(1 , std::make_pair (0 , 2 ), 10 ., 10 .);
950- auto & sOC = graph2.addEdge <Street>(2 , std::make_pair (0 , 3 ), 10 ., 10 .);
951- auto & sOD = graph2.addEdge <Street>(3 , std::make_pair (0 , 4 ), 10 ., 10 .);
952- auto & sAO = graph2.addEdge <Street>(4 , std::make_pair (1 , 0 ), 10 ., 10 .);
953- auto & sBO = graph2.addEdge <Street>(5 , std::make_pair (2 , 0 ), 10 ., 10 .);
954- auto & sCO = graph2.addEdge <Street>(6 , std::make_pair (3 , 0 ), 10 ., 10 .);
955- auto & sDO = graph2.addEdge <Street>(7 , std::make_pair (4 , 0 ), 10 ., 10 .);
939+ graph2.addNode <Intersection>(0 , std::make_pair (0 , 0 ));
940+ graph2.addNode <Intersection>(1 , std::make_pair (-1 , 1 ));
941+ graph2.addNode <Intersection>(2 , std::make_pair (1 , 1 ));
942+ graph2.addNode <Intersection>(3 , std::make_pair (1 , -1 ));
943+ graph2.addNode <Intersection>(4 , std::make_pair (-1 , -1 ));
944+ graph2.addEdge <Street>(0 , std::make_pair (0 , 1 ), 10 ., 10 .);
945+ graph2.addEdge <Street>(1 , std::make_pair (0 , 2 ), 10 ., 10 .);
946+ graph2.addEdge <Street>(2 , std::make_pair (0 , 3 ), 10 ., 10 .);
947+ graph2.addEdge <Street>(3 , std::make_pair (0 , 4 ), 10 ., 10 .);
948+ graph2.addEdge <Street>(4 , std::make_pair (1 , 0 ), 10 ., 10 .);
949+ graph2.addEdge <Street>(5 , std::make_pair (2 , 0 ), 10 ., 10 .);
950+ graph2.addEdge <Street>(6 , std::make_pair (3 , 0 ), 10 ., 10 .);
951+ graph2.addEdge <Street>(7 , std::make_pair (4 , 0 ), 10 ., 10 .);
956952 graph2.buildAdj ();
957953 Dynamics dynamics{graph2, 69 };
958954 dynamics.graph ().nodeSet ().at (0 )->setCapacity (3 );
0 commit comments