Skip to content
Snippets Groups Projects
Commit 7daa31b8 authored by spmohanty's avatar spmohanty
Browse files

Use RailAgentStatus when computing the percentage of done agents

parent bfc87cfe
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ import timeout_decorator
from flatland.core.env_observation_builder import DummyObservationBuilder
from flatland.envs.rail_env import RailEnv
from flatland.envs.agent_utils import RailAgentStatus
from flatland.envs.rail_generators import rail_from_file
from flatland.envs.schedule_generators import schedule_from_file
from flatland.evaluators import aicrowd_helpers
......@@ -445,7 +446,7 @@ class FlatlandRemoteEvaluationService:
complete = 0
for i_agent in range(self.env.get_num_agents()):
agent = self.env.agents[i_agent]
if agent.position == agent.target:
if agent.status in [RailAgentStatus.DONE, RailAgentStatus.DONE_REMOVED]:
complete += 1
percentage_complete = complete * 1.0 / self.env.get_num_agents()
self.simulation_percentage_complete[-1] = percentage_complete
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment