From dae6ffb6f5adbeba8cd2d2a7b70cd0fd4b9cb9ae Mon Sep 17 00:00:00 2001 From: Vadzim Valchkovich Date: Thu, 15 Jun 2023 21:32:49 +0200 Subject: [PATCH] no-log mode --- src/Engine.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Engine.py b/src/Engine.py index b41f6ad..b2ae7bc 100644 --- a/src/Engine.py +++ b/src/Engine.py @@ -48,6 +48,7 @@ class Engine: self.runnin: bool = False self.paused: bool = False self.show_fringe: bool = False + self.is_simulation: bool = False def build_field(self): s = self.square_size @@ -79,11 +80,16 @@ class Engine: def train_loop(self, stop_condition): print(colored("Simulation started", "green")) + real_action_duration = self.action_duration self.action_duration = 0 + self.is_simulation = True while stop_condition(self.action_clock): self.action() + self.action_duration = real_action_duration + self.is_simulation = False + return self.serviced_tables def user_interaction(self): @@ -156,6 +162,9 @@ class Engine: self.revoke_goal() def log_state(self, state: TemporaryState): + if self.is_simulation: + return + LOG_COLOR = "blue" print( colored("Action:", LOG_COLOR),