-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef48060
commit 234f7d6
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Example of how to use the Aquarium environment.""" | ||
|
||
from marl_aquarium import aquarium_v0 | ||
|
||
env = aquarium_v0.env( | ||
# draw_force_vectors=True, | ||
# draw_action_vectors=True, | ||
# draw_view_cones=True, | ||
# draw_hit_boxes=True, | ||
# draw_death_circles=True, | ||
) | ||
env.reset(seed=42) | ||
|
||
for agent in env.agent_iter(): | ||
observation, reward, termination, truncation, info = env.last() | ||
|
||
if termination or truncation: | ||
action = None | ||
else: | ||
# this is where you would insert your policy | ||
action = env.action_space(agent).sample() | ||
|
||
env.step(action) | ||
env.render() | ||
env.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters