main
moscowsky 4 weeks ago
parent 0a0e3db400
commit b34711ebc6

@ -3,7 +3,7 @@ import time
class RobotController(object): class RobotController(object):
def __init__(self, fire_ext_max_capacity = 5, collision_damage = 1, k_sof = 1, k_cas = 1, k_asset = 1, k_hp = 1): def __init__(self, fire_ext_max_capacity = 5, collision_damage = 1, k_sof = 1, k_cas = 1, k_asset = 1, k_hp = 1, fall_damage = 10):
# STATE VARIABLES # STATE VARIABLES
self._fire_ext_max_capacity = fire_ext_max_capacity self._fire_ext_max_capacity = fire_ext_max_capacity
@ -13,11 +13,13 @@ class RobotController(object):
self._hit_points = self._start_hp self._hit_points = self._start_hp
self._collision_damage = collision_damage self._collision_damage = collision_damage
self._charge_points = 100 self._charge_points = 100
self._fall_damage = fall_damage
self._collisions = [] self._collisions = []
self._exted_sofs = [] self._exted_sofs = []
self._found_casualty = [] self._found_casualty = []
self._found_assets = [] self._found_assets = []
self._falls = []
self._k_sof = k_sof self._k_sof = k_sof
self._k_cas = k_cas self._k_cas = k_cas
@ -53,7 +55,7 @@ class RobotController(object):
return score return score
def get_str_status(self): 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}" 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}\n - Collisions {len(self._collisions)}\n - Falls {len(self._falls)}"
return status return status
''' EVENTS ''' ''' EVENTS '''
@ -74,4 +76,8 @@ class RobotController(object):
self._found_assets.append((time_stamp, self._found_assets.append((time_stamp,
copy.deepcopy(asset_params))) copy.deepcopy(asset_params)))
def _register_fall(self, time_stamp):
self._falls.append(time_stamp)

Loading…
Cancel
Save