There are 2 refactored versions of the program which are in branch refactor/iter2
and refactor/iter2
respectively.
Refactor 1 exists in branch refactor/iter2. The version on the master/devel branch involves a problem that the probability list for stops includes the value for the final stop on a route which is not guaranteed to be 0, since it is decided by the configuration file. However, with nowhere to go, that probability needs to be 0. Therefore, this version of code will ignore the possibility of the final stop on a route when it is not specified as 0 in the configuration file.
Refactor 2 exists in branch refactor/iter3. This version is refactored by extracting 3 functions from the Update() function located in configuration_sim.cc. The functions extracted are: • GenBus() on line 97 in configuration_sim.cc aims at generateing busses. • UpdateRoute() on line 115 in configuration_sim.cc aims at updating routes. • UpdateBus() on line 124 in configuration_sim.cc aims at updating busses. The Update() function is doing the job of generating bus when necessary, updating the status of all routes and updating the busses. So I defined 3 additional functions to specify on each of the job for the reason that it shortens the original update function and makes it more readable for other potential developers.
Start
method, so the driver runs faster.