@@ -18,7 +18,6 @@ namespace fs = std::filesystem;
1818
1919std::atomic<unsigned int > progress{0 };
2020std::atomic<bool > bExitFlag{false };
21- uint nAgents{315 }; // 315 for error probability 0.3, 450 for error probability 0.05
2221
2322// uncomment these lines to print densities, flows and speeds
2423#define PRINT_DENSITIES
@@ -31,7 +30,7 @@ using Unit = unsigned int;
3130using Delay = uint8_t ;
3231
3332using Graph = dsm::Graph;
34- using Dynamics = dsm::FirstOrderDynamics<Delay> ;
33+ using Dynamics = dsm::FirstOrderDynamics;
3534using Street = dsm::Street;
3635using SpireStreet = dsm::SpireStreet;
3736using TrafficLight = dsm::TrafficLight;
@@ -43,9 +42,10 @@ void printLoadingBar(int const i, int const n) {
4342}
4443
4544int main (int argc, char ** argv) {
46- if (argc != 5 ) {
47- std::cerr << " Usage: " << argv[0 ]
48- << " <SEED> <ERROR_PROBABILITY> <OUT_FOLDER_BASE> <OPTIMIZE>\n " ;
45+ if (argc != 6 ) {
46+ std::cerr
47+ << " Usage: " << argv[0 ]
48+ << " <SEED> <ERROR_PROBABILITY> <OUT_FOLDER_BASE> <OPTIMIZE> <INIT_NAGENTS>\n " ;
4949 return 1 ;
5050 }
5151
@@ -54,6 +54,7 @@ int main(int argc, char** argv) {
5454 std::string BASE_OUT_FOLDER{argv[3 ]};
5555 const bool OPTIMIZE{std::string (argv[4 ]) != std::string (" 0" )};
5656 BASE_OUT_FOLDER += OPTIMIZE ? " _op/" : " /" ;
57+ auto nAgents{std::stoul (argv[5 ])};
5758
5859 const std::string IN_MATRIX{" ./data/matrix.dat" }; // input matrix file
5960 const std::string IN_COORDS{" ./data/coordinates.dsm" }; // input coords file
@@ -68,6 +69,7 @@ int main(int argc, char** argv) {
6869 std::cout << " Seed: " << SEED << ' \n ' ;
6970 std::cout << " Error probability: " << ERROR_PROBABILITY << ' \n ' ;
7071 std::cout << " Base output folder: " << BASE_OUT_FOLDER << ' \n ' ;
72+ std::cout << " Initial number of agents: " << nAgents << ' \n ' ;
7173 if (OPTIMIZE) {
7274 std::cout << " Traffic light optimization ENABLED.\n " ;
7375 }
@@ -89,12 +91,11 @@ int main(int argc, char** argv) {
8991 graph.importCoordinates (IN_COORDS);
9092 std::cout << " Setting street parameters..." << ' \n ' ;
9193 for (const auto & [streetId, street] : graph.streetSet ()) {
92- street->setLength (2e3 );
93- street->setCapacity (225 );
9494 street->setTransportCapacity (1 );
9595 street->setMaxSpeed (13.9 );
9696 }
9797 graph.buildAdj ();
98+ graph.normalizeStreetCapacities ();
9899 const auto dv = graph.adjMatrix ().getDegreeVector ();
99100
100101 // graph.addStreet(Street(100002, std::make_pair(0, 108)));
0 commit comments