mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-11-02 21:47:25 +01:00
removed positionmix entirely (now also in collection)
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin, HasBoundMixin
|
||||
from marl_factory_grid.modules.batteries.entitites import Pod, Battery
|
||||
|
||||
|
||||
class Batteries(Collection):
|
||||
|
||||
_entity = Battery
|
||||
is_blocking_light: bool = False
|
||||
can_collide: bool = False
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_collide(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def obs_tag(self):
|
||||
@@ -21,7 +34,7 @@ class Batteries(Collection):
|
||||
self.add_items(batteries)
|
||||
|
||||
|
||||
class ChargePods(PositionMixin, Collection):
|
||||
class ChargePods(Collection):
|
||||
|
||||
_entity = Pod
|
||||
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
from marl_factory_grid.environment import constants as c
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
from marl_factory_grid.modules.clean_up.entitites import DirtPile
|
||||
|
||||
from marl_factory_grid.environment import constants as c
|
||||
|
||||
|
||||
class DirtPiles(PositionMixin, Collection):
|
||||
class DirtPiles(Collection):
|
||||
_entity = DirtPile
|
||||
is_blocking_light: bool = False
|
||||
can_collide: bool = False
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_collide(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def amount(self):
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
from marl_factory_grid.modules.destinations.entitites import Destination
|
||||
from marl_factory_grid.environment import constants as c
|
||||
from marl_factory_grid.modules.destinations import constants as d
|
||||
|
||||
|
||||
class Destinations(PositionMixin, Collection):
|
||||
class Destinations(Collection):
|
||||
_entity = Destination
|
||||
is_blocking_light: bool = False
|
||||
can_collide: bool = False
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_collide(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
from typing import Union
|
||||
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
from marl_factory_grid.modules.doors import constants as d
|
||||
from marl_factory_grid.modules.doors.entitites import Door
|
||||
|
||||
|
||||
class Doors(PositionMixin, Collection):
|
||||
class Doors(Collection):
|
||||
|
||||
symbol = d.SYMBOL_DOOR
|
||||
_entity = Door
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Doors, self).__init__(*args, can_collide=True, **kwargs)
|
||||
|
||||
|
||||
@@ -5,14 +5,18 @@ from marl_factory_grid.environment import constants as c
|
||||
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.objects import _Objects
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin, IsBoundMixin, HasBoundMixin
|
||||
from marl_factory_grid.environment.groups.mixins import IsBoundMixin, HasBoundMixin
|
||||
from marl_factory_grid.environment.entity.agent import Agent
|
||||
from marl_factory_grid.modules.items.entitites import Item, DropOffLocation
|
||||
|
||||
|
||||
class Items(PositionMixin, Collection):
|
||||
class Items(Collection):
|
||||
_entity = Item
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def is_blocking_light(self):
|
||||
return False
|
||||
@@ -103,17 +107,25 @@ class Inventories(HasBoundMixin, _Objects):
|
||||
state[i.INVENTORY].spawn(state[c.AGENT])
|
||||
|
||||
|
||||
class DropOffLocations(PositionMixin, Collection):
|
||||
class DropOffLocations(Collection):
|
||||
_entity = DropOffLocation
|
||||
|
||||
@property
|
||||
def is_blocking_light(self):
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def can_collide(self):
|
||||
def var_can_collide(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(DropOffLocations, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
|
||||
from .entitites import Machine
|
||||
|
||||
|
||||
class Machines(PositionMixin, Collection):
|
||||
class Machines(Collection):
|
||||
|
||||
_entity = Machine
|
||||
is_blocking_light: bool = False
|
||||
can_collide: bool = False
|
||||
|
||||
@property
|
||||
def var_can_collide(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Machines, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
from marl_factory_grid.environment.groups.collection import Collection
|
||||
from marl_factory_grid.environment.groups.mixins import PositionMixin
|
||||
from .entities import Maintainer
|
||||
from ..machines import constants as mc
|
||||
from ..machines.actions import MachineAction
|
||||
from ...utils.states import Gamestate
|
||||
|
||||
|
||||
class Maintainers(PositionMixin, Collection):
|
||||
|
||||
class Maintainers(Collection):
|
||||
_entity = Maintainer
|
||||
var_can_collide = True
|
||||
var_can_move = True
|
||||
var_is_blocking_light = False
|
||||
var_has_position = True
|
||||
|
||||
@property
|
||||
def var_can_collide(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def var_is_blocking_light(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def var_has_position(self):
|
||||
return True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user