diff --git a/flee/Diagnostics.py b/flee/Diagnostics.py index f3289060..575cb918 100644 --- a/flee/Diagnostics.py +++ b/flee/Diagnostics.py @@ -63,15 +63,24 @@ def write_agents_par( if a.location is None: #Do not write agent logs for agents that are removed from the simulation. continue + loc_name = a.location.name + x = a.location.x + y = a.location.y + + if SimulationSettings.log_levels["granularity"] == "region": + loc_name = location.region + x = 0.0 + y = 0.0 + print( "{},{}-{},{},{},{},{},{},{},{},{},{}".format( time, rank, k, a.home_location.name, - a.location.name, - a.location.x, - a.location.y, + loc_name, + x, + y, a.travelling, a.distance_travelled, a.places_travelled, diff --git a/flee/SimulationSettings.py b/flee/SimulationSettings.py index d1ac9792..080b873a 100644 --- a/flee/SimulationSettings.py +++ b/flee/SimulationSettings.py @@ -97,7 +97,7 @@ def ReadFromYML(ymlfile: str): SimulationSettings.log_levels["conflict"] = int(fetchss(dpll,"conflict",0)) SimulationSettings.log_levels["idp_totals"] = int(fetchss(dpll,"idp_totals",0)) - SimulationSettings.log_levels["spatial_granularity"] = fetchss(dpll,"spatial_granularity","location") + SimulationSettings.log_levels["granularity"] = fetchss(dpll,"granularity","location") # location, admin3 or admin2