mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-05 17:11:35 +02:00
Merge branch 'main' into unit_testing
This commit is contained in:
@ -28,14 +28,19 @@ class Maintainer(Entity):
|
||||
def tick(self, state):
|
||||
if found_objective := h.get_first(state[self.objective].by_pos(self.pos)):
|
||||
if found_objective.name != self._last_serviced:
|
||||
self.action.do(self, state)
|
||||
result = self.action.do(self, state)
|
||||
self._last_serviced = found_objective.name
|
||||
else:
|
||||
action = self.get_move_action(state)
|
||||
return action.do(self, state)
|
||||
result = action.do(self, state)
|
||||
else:
|
||||
action = self.get_move_action(state)
|
||||
return action.do(self, state)
|
||||
result = action.do(self, state)
|
||||
self.set_state(result)
|
||||
return result
|
||||
|
||||
def set_state(self, action_result):
|
||||
self._status = action_result
|
||||
|
||||
def get_move_action(self, state) -> Action:
|
||||
if self._path is None or not len(self._path):
|
||||
|
Reference in New Issue
Block a user