From 0a0e3db40072cb5e777ab4179f9aa252ca20c7e8 Mon Sep 17 00:00:00 2001 From: moscowsky Date: Tue, 23 Jun 2026 13:15:31 +0300 Subject: [PATCH] strong status added --- robot_controller.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/robot_controller.py b/robot_controller.py index cb53950..4b6855c 100644 --- a/robot_controller.py +++ b/robot_controller.py @@ -3,13 +3,14 @@ import time class RobotController(object): - def __init__(self, fire_ext_max_capacity = 5, collision_damage = 1, k_sof = 1, k_cas = 1, k_asset = 1): + def __init__(self, fire_ext_max_capacity = 5, collision_damage = 1, k_sof = 1, k_cas = 1, k_asset = 1, k_hp = 1): # STATE VARIABLES self._fire_ext_max_capacity = fire_ext_max_capacity self._fire_ext_capacity = self._fire_ext_max_capacity - self._hit_points = 100 + self._start_hp = 100 + self._hit_points = self._start_hp self._collision_damage = collision_damage self._charge_points = 100 @@ -21,6 +22,7 @@ class RobotController(object): self._k_sof = k_sof self._k_cas = k_cas self._k_asset = k_asset + self._k_hp = k_hp ''' CONTROL ''' @@ -46,10 +48,14 @@ class RobotController(object): def send_pick_asset_cmd(self): raise NotImplemented("") - def get_score(self, time_stamp): - score = self._k_sof * len(self._exted_sofs) + self._k_cas * len(self._found_casualty) + self.k_assest * len(self._found_assets) + def get_score(self, time_stamp = None): + score = self._k_sof * len(self._exted_sofs) + self._k_cas * len(self._found_casualty) + self._k_asset * len(self._found_assets) + self._k_hp * self._hit_points return score + def get_str_status(self): + status = f"{type(self).__name__}\n - Total score {self.get_score()}\n - Hit points: {self._hit_points}/{self._start_hp}\n - Extingushed sources of fire {len(self._exted_sofs)}\n - Fire extinguiher capacity {self._fire_ext_capacity}/{self._fire_ext_max_capacity}" + return status + ''' EVENTS ''' def _register_collision(self, time_stamp):