mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-11 23:42:40 +02:00
all vars are properties, removed comments
This commit is contained in:
README.md
marl_factory_grid
environment
entity
groups
modules
batteries
clean_up
destinations
maintenance
zones
utils
@ -45,10 +45,6 @@ class DirtPiles(PositionMixin, Collection):
|
||||
def trigger_dirt_spawn(self, state, initial_spawn=False) -> bool:
|
||||
free_for_dirt = [x for x in state.entities.floorlist if len(state.entities.pos_dict[x]) == 1 or (
|
||||
len(state.entities.pos_dict[x]) == 2 and isinstance(next(y for y in x), DirtPile))]
|
||||
# free_for_dirt = [x for x in state[c.FLOOR]
|
||||
# if len(x.guests) == 0 or (
|
||||
# len(x.guests) == 1 and
|
||||
# isinstance(next(y for y in x.guests), DirtPile))]
|
||||
state.rng.shuffle(free_for_dirt)
|
||||
|
||||
var = self.dirt_spawn_r_var
|
||||
|
@ -54,7 +54,7 @@ class DirtSmearOnMove(Rule):
|
||||
if is_move(entity.state.identifier) and entity.state.validity == c.VALID:
|
||||
if old_pos_dirt := state[d.DIRT].by_pos(entity.last_pos):
|
||||
if smeared_dirt := round(old_pos_dirt.amount * self.smear_amount, 2):
|
||||
if state[d.DIRT].spawn(entity.pos, amount=smeared_dirt): # pos statt tile
|
||||
if state[d.DIRT].spawn(entity.pos, amount=smeared_dirt):
|
||||
results.append(TickResult(identifier=self.name, entity=entity,
|
||||
reward=0, validity=c.VALID))
|
||||
return results
|
||||
|
Reference in New Issue
Block a user