Skip to content

Commit

Permalink
Reduced verbosity of conflict adding in parallel runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
djgroen committed Oct 11, 2023
1 parent 2c652fe commit acb9b46
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions flee/InputGeography.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,30 +441,33 @@ def AddNewConflictZones(self, e, time: int, Debug: bool = False) -> None:
conflict_names = self.getConflictLocationNames()
# print(confl_names)
for conflict_name in conflict_names:
if Debug:
if Debug and e.getRankN(e.time) is True:
print("L:", conflict_name, self.conflicts[conflict_name], time, file=sys.stderr)
if self.conflicts[conflict_name][time] > 0.000001:
if time > 0:
if self.conflicts[conflict_name][time - 1] < 0.000001:
if e.getRankN(e.time) is True:
print(
"Time = {}. Adding a new conflict zone [{}] with intensity {}".format(
time, conflict_name, self.conflicts[conflict_name][time]
),
file=sys.stderr,
)
e.set_conflict_intensity(name=conflict_name, conflict_intensity=self.conflicts[conflict_name][time])
else:
if e.getRankN(e.time) is True:
print(
"Time = {}. Adding a new conflict zone [{}] with intensity {}".format(
time, conflict_name, self.conflicts[conflict_name][time]
),
file=sys.stderr,
)
e.set_conflict_intensity(name=conflict_name, conflict_intensity=self.conflicts[conflict_name][time])
else:
print(
"Time = {}. Adding a new conflict zone [{}] with intensity {}".format(
time, conflict_name, self.conflicts[conflict_name][time]
),
file=sys.stderr,
)
e.add_conflict_zone(name=conflict_name, conflict_intensity=self.conflicts[conflict_name][time])
if self.conflicts[conflict_name][time] < 0.000001 and time > 0:
if self.conflicts[conflict_name][time - 1] >= 0.000001:
print(
"Time = {}. Removing conflict zone [{}]".format(time, conflict_name),
file=sys.stderr,
)
if e.getRankN(e.time) is True:
print(
"Time = {}. Removing conflict zone [{}]".format(time, conflict_name),
file=sys.stderr,
)
e.set_conflict_intensity(name=conflict_name, conflict_intensity=self.conflicts[conflict_name][time])

0 comments on commit acb9b46

Please sign in to comment.