Description and better naming scheme for the Door-Module

This commit is contained in:
Steffen Illium
2023-10-26 16:12:19 +02:00
parent 6011ba383e
commit 20068e8e1b
3 changed files with 18 additions and 5 deletions

View File

@@ -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):