mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-05 17:11:35 +02:00
Comments, small bugfixes removed legacy elements
This commit is contained in:
@ -11,15 +11,33 @@ from marl_factory_grid.environment.entity.object import Object
|
||||
class PlaceHolder(Object):
|
||||
|
||||
def __init__(self, *args, fill_value=0, **kwargs):
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
super().__init__(*args, **kwargs)
|
||||
self._fill_value = fill_value
|
||||
|
||||
@property
|
||||
def can_collide(self):
|
||||
def var_can_collide(self):
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
return False
|
||||
|
||||
@property
|
||||
def encoding(self):
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
return self._fill_value
|
||||
|
||||
@property
|
||||
@ -29,14 +47,30 @@ class PlaceHolder(Object):
|
||||
|
||||
class GlobalPosition(Object):
|
||||
|
||||
@property
|
||||
def obs_tag(self):
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def encoding(self):
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
if self._normalized:
|
||||
return tuple(np.divide(self._bound_entity.pos, self._shape))
|
||||
else:
|
||||
return self.bound_entity.pos
|
||||
|
||||
def __init__(self, agent, level_shape, *args, normalized: bool = True, **kwargs):
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
super(GlobalPosition, self).__init__(*args, **kwargs)
|
||||
self.bind_to(agent)
|
||||
self._normalized = normalized
|
||||
|
Reference in New Issue
Block a user