mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-12-06 15:40:37 +01:00
Resolved some warnings and style issues
This commit is contained in:
@@ -56,8 +56,8 @@ class TSPBaseAgent(ABC):
|
||||
|
||||
def _door_is_close(self, state):
|
||||
try:
|
||||
# return next(y for x in self.state.tile.neighboring_floor for y in x.guests if do.DOOR in y.name)
|
||||
return next(y for x in state.entities.neighboring_positions(self.state.pos) for y in state.entities.pos_dict[x] if do.DOOR in y.name)
|
||||
return next(y for x in state.entities.neighboring_positions(self.state.pos)
|
||||
for y in state.entities.pos_dict[x] if do.DOOR in y.name)
|
||||
except StopIteration:
|
||||
return None
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ class TSPTargetAgent(TSPBaseAgent):
|
||||
def _handle_doors(self, state):
|
||||
|
||||
try:
|
||||
# return next(y for x in self.state.tile.neighboring_floor for y in x.guests if do.DOOR in y.name)
|
||||
return next(y for x in state.entities.neighboring_positions(self.state.pos) for y in state.entities.pos_dict[x] if do.DOOR in y.name)
|
||||
return next(y for x in state.entities.neighboring_positions(self.state.pos)
|
||||
for y in state.entities.pos_dict[x] if do.DOOR in y.name)
|
||||
except StopIteration:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user