Skip to content

Commit

Permalink
Merge pull request #494 from LLNL/abmarl-0-pacman-hotfix
Browse files Browse the repository at this point in the history
Fixed pacman agents init
  • Loading branch information
rusu24edward authored Mar 5, 2024
2 parents 912cd65 + f30c2e2 commit cb2184e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions abmarl/examples/sim/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,34 @@


class PacmanAgent(MovingAgent, OrientationAgent, GridObservingAgent, HealthAgent):
def __init__(self, **kwargs):
super().__init__(move_range=1, view_range=100, initial_health=1, **kwargs)
def __init__(self, move_range=1, view_range=100, initial_health=1, **kwargs):
super().__init__(
move_range=move_range,
view_range=view_range,
initial_health=initial_health,
**kwargs
)


class WallAgent(GridWorldAgent): pass


class FoodAgent(HealthAgent):
def __init__(self, **kwargs):
super().__init__(render_size=50, initial_health=1, **kwargs)
def __init__(self, render_size=50, initial_health=1, **kwargs):
super().__init__(
render_size=render_size,
initial_health=initial_health,
**kwargs
)


class BaddieAgent(MovingAgent, OrientationAgent, GridObservingAgent):
def __init__(self, **kwargs):
super().__init__(move_range=1, view_range=100, **kwargs)
def __init__(self, move_range=1, view_range=100, **kwargs):
super().__init__(
move_range=move_range,
view_range=view_range,
**kwargs
)


class PacmanSim(SmartGridWorldSimulation):
Expand Down
2 changes: 1 addition & 1 deletion examples/rllib_pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'P': lambda n: PacmanAgent(
id='pacman',
encoding=1,
# view_range=2,
view_range=2,
render_color='yellow',
),
'W': lambda n: WallAgent(
Expand Down

0 comments on commit cb2184e

Please sign in to comment.