mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-12-20 22:06:07 +01:00
New Szenario "Two_Rooms_One_Door"
This commit is contained in:
@@ -12,6 +12,22 @@ from marl_factory_grid.environment import constants as c
|
||||
|
||||
class Agent(Entity):
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def var_is_blocking_pos(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def obs_tag(self):
|
||||
return self.name
|
||||
|
||||
@@ -9,7 +9,7 @@ class BoundEntityMixin:
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return f'{self.__class__.__name__}({self._bound_entity.name})'
|
||||
return f'{self.__class__.__name__}({self.bound_entity.name})'
|
||||
|
||||
def belongs_to_entity(self, entity):
|
||||
return entity == self.bound_entity
|
||||
|
||||
@@ -21,7 +21,7 @@ class Object:
|
||||
def name(self):
|
||||
if self._str_ident is not None:
|
||||
return f'{self.__class__.__name__}[{self._str_ident}]'
|
||||
return f'{self.__class__.__name__}#{self.identifier_int}'
|
||||
return f'{self.__class__.__name__}#{self.u_int}'
|
||||
|
||||
@property
|
||||
def identifier(self):
|
||||
@@ -30,10 +30,14 @@ class Object:
|
||||
else:
|
||||
return self.name
|
||||
|
||||
def reset_uid(self):
|
||||
self._u_idx = defaultdict(lambda: 0)
|
||||
return True
|
||||
|
||||
def __init__(self, str_ident: Union[str, None] = None, **kwargs):
|
||||
self._observers = []
|
||||
self._str_ident = str_ident
|
||||
self.identifier_int = self._identify_and_count_up()
|
||||
self.u_int = self._identify_and_count_up()
|
||||
self._collection = None
|
||||
|
||||
if kwargs:
|
||||
|
||||
@@ -30,10 +30,6 @@ class Floor(EnvObject):
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def neighboring_floor_pos(self):
|
||||
return [x.pos for x in self.neighboring_floor]
|
||||
|
||||
@property
|
||||
def neighboring_floor(self):
|
||||
if self._neighboring_floor:
|
||||
|
||||
Reference in New Issue
Block a user