mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-09-15 23:37:14 +02:00
WIP: collection, entities, objects
This commit is contained in:
@@ -16,10 +16,9 @@ class Entity(Object, abc.ABC):
|
||||
def state(self):
|
||||
return self._status or ActionResult(entity=self, identifier=c.NOOP, validity=c.VALID, reward=0)
|
||||
|
||||
# @property
|
||||
# def var_has_position(self):
|
||||
# return self.pos != c.VALUE_NO_POS
|
||||
var_has_position: bool = True
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return self.pos != c.VALUE_NO_POS
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
@@ -28,7 +27,6 @@ class Entity(Object, abc.ABC):
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
# var_is_blocking_light: bool = True
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
@@ -51,7 +49,6 @@ class Entity(Object, abc.ABC):
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
# var_can_collide: bool = True
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
|
@@ -5,13 +5,13 @@ from marl_factory_grid.environment import constants as c
|
||||
|
||||
|
||||
class Object:
|
||||
|
||||
"""Generell Objects for Organisation and Maintanance such as Actions etc..."""
|
||||
|
||||
_u_idx = defaultdict(lambda: 0)
|
||||
|
||||
def __bool__(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def var_has_position(self): # brauchen wir das hier jetzt?
|
||||
try:
|
||||
@@ -93,11 +93,10 @@ class Object:
|
||||
|
||||
|
||||
class EnvObject(Object):
|
||||
|
||||
"""Objects that hold Information that are observable, but have no position on the environment grid. Inventories etc..."""
|
||||
|
||||
_u_idx = defaultdict(lambda: 0)
|
||||
|
||||
|
||||
@property
|
||||
def obs_tag(self):
|
||||
try:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
from marl_factory_grid.environment.entity.agent import Agent
|
||||
from marl_factory_grid.environment.groups.env_objects import Collection
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
|
||||
|
||||
|
@@ -3,7 +3,7 @@ from typing import List, Union
|
||||
import numpy as np
|
||||
|
||||
from marl_factory_grid.environment.entity.util import GlobalPosition
|
||||
from marl_factory_grid.environment.groups.env_objects import Collection
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin, HasBoundMixin
|
||||
from marl_factory_grid.environment.groups.objects import Objects
|
||||
from marl_factory_grid.modules.zones import Zone
|
||||
|
@@ -2,7 +2,7 @@ import random
|
||||
from typing import List, Tuple
|
||||
|
||||
from marl_factory_grid.environment import constants as c
|
||||
from marl_factory_grid.environment.groups.env_objects import Collection
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
from marl_factory_grid.environment.entity.wall_floor import Wall, Floor
|
||||
|
||||
|
Reference in New Issue
Block a user