agentsoz / ees

Emergency Evacuation Simulator
MIT License
9 stars 6 forks source link

Add support for custom routing algorithms #27

Closed dhixsingh closed 5 years ago

dhixsingh commented 5 years ago

We want to be able to try different routing algorithms in place of the routing algorithms provided by MATSim.

dhixsingh commented 5 years ago

Available since 55ac705. There is now a new routing algorithm in the io.github.agentsoz.ees.matsim.router package that does nothing useful and is there mainly to be used as a template for new algorithms: https://github.com/agentsoz/ees/blob/7c827b105058879ca0acf9c1b1679841cbd23b66/src/main/java/io/github/agentsoz/ees/matsim/router/ExampleRoutingAlgorithm.java#L51-L56

Any new routing algorithms (and their factories) can now be added to the io.github.agentsoz.ees.matsim.router package as above. To use them they will need to be added to the routing algorithm types, https://github.com/agentsoz/ees/blob/7c827b105058879ca0acf9c1b1679841cbd23b66/src/main/java/io/github/agentsoz/ees/matsim/MATSimEvacModel.java#L102 and then bound to MATSim's LeastCostPathCalculatorFactory in the function below: https://github.com/agentsoz/ees/blob/7c827b105058879ca0acf9c1b1679841cbd23b66/src/main/java/io/github/agentsoz/ees/matsim/MATSimEvacModel.java#L415-L419

The algorithm can then be specified via the config as follows: https://github.com/agentsoz/ees/blob/55ac7056bab41a5ad2dbbb49888df28e7e97479f/scenarios/surf-coast-shire/population-subgroups/ees-custom-routing.xml#L93

There is now a new integration test that uses the example routing algorithm (and fails given that the router just throws an error): https://github.com/agentsoz/ees/blob/8f29ebf72eb9c3b042f2d6d4df320a99612f3dbe/src/test/java/io/github/agentsoz/ees/SurfCoastShirePopulationSubgroupsCustomRoutingIT.java#L47-L54