mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-06-20 03:08:08 +02:00
Resolved some warnings and style issues
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
from typing import List
|
||||
|
||||
import marl_factory_grid.modules.maintenance.constants
|
||||
from marl_factory_grid.environment.rules import Rule
|
||||
from marl_factory_grid.utils.results import TickResult, DoneResult
|
||||
from marl_factory_grid.environment import constants as c
|
||||
from . import rewards as r
|
||||
from . import constants as M
|
||||
|
||||
|
||||
class MoveMaintainers(Rule):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def tick_step(self, state) -> List[TickResult]:
|
||||
for maintainer in state[M.MAINTAINERS]:
|
||||
@ -20,8 +21,8 @@ class MoveMaintainers(Rule):
|
||||
|
||||
class DoneAtMaintainerCollision(Rule):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def on_check_done(self, state) -> List[DoneResult]:
|
||||
agents = list(state[c.AGENT].values())
|
||||
@ -30,5 +31,5 @@ class DoneAtMaintainerCollision(Rule):
|
||||
for agent in agents:
|
||||
if agent.pos in m_pos:
|
||||
done_results.append(DoneResult(entity=agent, validity=c.VALID, identifier=self.name,
|
||||
reward=r.MAINTAINER_COLLISION_REWARD))
|
||||
reward=marl_factory_grid.modules.maintenance.constants.MAINTAINER_COLLISION_REWARD))
|
||||
return done_results
|
||||
|
Reference in New Issue
Block a user