TomorrowsCities / tomorrowscities

MIT License
3 stars 1 forks source link

Incorrect metric 2 #33

Closed jamaldabbeek closed 1 month ago

jamaldabbeek commented 5 months ago

The closest school was associated with a non-flooded node, however metric 2 (Number of children with no access to education) is not zero image v civil socities group.zip

eminmentese commented 5 months ago

Hi Jamal, can you check whether one of those conditions are met for the scenario. https://github.com/TomorrowsCities/tomorrowscities/wiki/2%E2%80%90Definitions (please see Metric 2 definitions) In addition to these, if a person who is assigned to a school and its building is damaged, this also causes lack of access to schools. This needs revision in the wiki definition.

As a result, the Metric2 is not only related to "damage to school".

But if these conditions are still not met and the metric is more than "0", we must dig into it.

hkayabilisim commented 5 months ago

The problem is related to the road topology. Each road (graph edge) connects the nodes "from_node" and "to_node". By default engine uses a directed graph to represent the road network. As the connectivity analysis depends on the direction , the accessibility-dependent metrics becomes higher than expected.

The reason why we haven't seen this phenenoma is that all the road networks used in previous cases had bi-directional meaning that every edge has an opposite pair.

To create a generic solution to this kind of situations, we added a new option to settings: preserve_edge_directions. If this option is enabled, then the engine accepts the directions present in road/power network and do all connectivity analysis in directed context. If it is not selected (this is the default behaviour), then the engine converts it to an undirected graph.

The fix is here: https://github.com/TomorrowsCities/tomorrowscities/pull/34

Please update your local git repo to test the new features.

hkayabilisim commented 5 months ago

Buildings with no access to hospitals are mostly populated north of river bed around which roads are flooded which the hospital is in south east. (Only the flooded buildings are shown in the map) See below:

image