Skip to content

Commit

Permalink
update agent DoneCreteria
Browse files Browse the repository at this point in the history
  • Loading branch information
JingfeiPeng committed Apr 30, 2021
1 parent e72b31c commit 313db28
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/game_of_tag/game_of_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from smarts.env.rllib_hiway_env import RLlibHiWayEnv
from smarts.core.agent import AgentSpec, Agent
from smarts.core.controllers import ActionSpaceType
from smarts.core.agent_interface import AgentInterface, AgentType, DoneCriteria
from smarts.core.agent_interface import AgentInterface, AgentType, DoneCriteria, AgentsAliveDoneCriteria, AgentsListAlive
from smarts.core.utils.file import copy_tree


Expand Down Expand Up @@ -105,6 +105,16 @@ def stop_all(self):
off_route=False,
wrong_way=False,
collision=True,
agents_alive=AgentsAliveDoneCriteria(
agent_lists_alive=[
AgentsListAlive(
agents_list=PREY_IDS, minimum_agents_alive_in_list=1
),
AgentsListAlive(
agents_list=PREDATOR_IDS, minimum_agents_alive_in_list=1
),
]
),
)

for agent_id in PREDATOR_IDS:
Expand Down

0 comments on commit 313db28

Please sign in to comment.