Skip to content

Commit

Permalink
Better think time error message
Browse files Browse the repository at this point in the history
  • Loading branch information
fdraxler committed Mar 26, 2021
1 parent 5ea78e0 commit 1b11c1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,10 @@ def poll_and_run_agents(self):
action, think_time = a.wait_for_act()
self.logger.info(f'Agent <{a.name}> chose action {action} in {think_time:.2f}s.')
if think_time > a.available_think_time:
self.logger.warning(f'Agent <{a.name}> exceeded think time by {s.TIMEOUT - think_time}s. Setting action to "WAIT" and decreasing available time for next round.')
next_think_time = s.TIMEOUT - (think_time - a.available_think_time)
self.logger.warning(f'Agent <{a.name}> exceeded think time by {a.available_think_time - think_time:.2f}s. Setting action to "WAIT" and decreasing available time for next round to {next_think_time:.2f}.')
action = "WAIT"
a.available_think_time = s.TIMEOUT - (think_time - a.available_think_time)
a.available_think_time = next_think_time
else:
self.logger.info(f'Agent <{a.name}> stayed within acceptable think time.')
a.available_think_time = s.TIMEOUT
Expand Down

0 comments on commit 1b11c1b

Please sign in to comment.