diff --git a/README.md b/README.md index 34208d6..68e99e8 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Just define what your environment needs in a *yaml*-configfile like: done_at_collisions: !!bool True ItemRespawn: spawn_freq: 5 - DoorAutoClose: {} + DoDoorAutoClose: {} Assets: - Defaults diff --git a/marl_factory_grid/modules/doors/__init__.py b/marl_factory_grid/modules/doors/__init__.py index 4f1d0a2..262f556 100644 --- a/marl_factory_grid/modules/doors/__init__.py +++ b/marl_factory_grid/modules/doors/__init__.py @@ -1,4 +1,4 @@ from .actions import DoorUse from .entitites import Door, DoorIndicator from .groups import Doors -from .rules import DoorAutoClose, DoorIndicateArea +from .rules import DoDoorAutoClose, IndicateDoorAreaInObservation diff --git a/marl_factory_grid/modules/doors/rules.py b/marl_factory_grid/modules/doors/rules.py index babe61f..3937f4a 100644 --- a/marl_factory_grid/modules/doors/rules.py +++ b/marl_factory_grid/modules/doors/rules.py @@ -1,13 +1,19 @@ -from marl_factory_grid.environment.rules import Rule from marl_factory_grid.environment import constants as c +from marl_factory_grid.environment.rules import Rule from marl_factory_grid.utils.results import TickResult from . import constants as d from .entitites import DoorIndicator -class DoorAutoClose(Rule): +class DoDoorAutoClose(Rule): def __init__(self, close_frequency: int = 10): + """ + This rule closes doors, that have been opened automatically, when no entity is blocking the position. + + :type close_frequency: int + :param close_frequency: How many ticks after opening, should the door close? + """ super().__init__() self.close_frequency = close_frequency @@ -22,9 +28,16 @@ class DoorAutoClose(Rule): return [] -class DoorIndicateArea(Rule): +class IndicateDoorAreaInObservation(Rule): def __init__(self): + """ + Whether to add an indicator aka place a value around doors (within the door tile), for agents to see. + This could improve learning. + + """ + # Todo: Discuss if this rather be a single entity with a standalone observation. + # Could then be combined with the "Combine"-approach. super().__init__() def on_init(self, state, lvl_map):