From 5e5865d0d56485eb186ab0ae8af674946e19c3b0 Mon Sep 17 00:00:00 2001 From: robbe Date: Thu, 24 Apr 2025 12:25:44 +0200 Subject: [PATCH] base_case of len == 0 added (same as Interactive decisionMaker) --- util/simulator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/simulator.py b/util/simulator.py index cdbe6a6..c967bbd 100644 --- a/util/simulator.py +++ b/util/simulator.py @@ -27,6 +27,8 @@ class RandomDecisionMaker(DecisionMaker): def __call__(self, actions): arr = [action for descr, action in actions] + if len(arr) == 0: + return i = math.floor(self.r.random()*len(arr)) return arr[i] @@ -91,7 +93,7 @@ class MinimalSimulator: self._print("Start simulation") self._print(f"Decision maker: {self.decision_maker}") step_counter = 0 - while True: + while step_counter < 10: termination_reason = self.termination_condition(model) if termination_reason != None: self._print(f"Termination condition satisfied.\nReason: {termination_reason}.")