fixed names and function, dirtspawn and item spawn

This commit is contained in:
Steffen Illium
2023-10-30 11:11:35 +01:00
parent ac557232a1
commit 374a38971a
16 changed files with 56 additions and 47 deletions

@ -12,7 +12,7 @@ class BoundEntityMixin:
if self.bound_entity:
return f'{self.__class__.__name__}({self.bound_entity.name})'
else:
print()
pass
def belongs_to_entity(self, entity):
return entity == self.bound_entity

@ -131,6 +131,7 @@ class EnvObject(Object):
return c.VALUE_OCCUPIED_CELL
def __init__(self, **kwargs):
self._bound_entity = None
super(EnvObject, self).__init__(**kwargs)
def change_parent_collection(self, other_collection):

@ -1,6 +1,6 @@
from collections import defaultdict
from operator import itemgetter
from random import shuffle
from random import shuffle, random
from typing import Dict
from marl_factory_grid.environment.groups.objects import Objects
@ -26,6 +26,7 @@ class Entities(Objects):
@property
def floorlist(self):
shuffle(self._floor_positions)
return self._floor_positions
def __init__(self, floor_positions):