Skip to content
Snippets Groups Projects
Commit 8bbb7c9d authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files
parents 0ad1737f ebd2868b
No related branches found
No related tags found
No related merge requests found
File added
File added
File added
...@@ -36,7 +36,7 @@ env = RailEnv(width=20, ...@@ -36,7 +36,7 @@ env = RailEnv(width=20,
env = RailEnv(width=15, env = RailEnv(width=15,
height=15, height=15,
rail_generator=complex_rail_generator(nr_start_goal=10, nr_extra=10, min_dist=10, max_dist=99999, seed=0), rail_generator=complex_rail_generator(nr_start_goal=10, nr_extra=10, min_dist=10, max_dist=99999, seed=0),
number_of_agents=10) number_of_agents=5)
""" """
env = RailEnv(width=20, env = RailEnv(width=20,
...@@ -46,7 +46,7 @@ env = RailEnv(width=20, ...@@ -46,7 +46,7 @@ env = RailEnv(width=20,
number_of_agents=3) number_of_agents=3)
""" """
env_renderer = RenderTool(env, gl="QT") env_renderer = RenderTool(env, gl="QTSVG")
handle = env.get_agent_handles() handle = env.get_agent_handles()
state_size = 105 * 2 state_size = 105 * 2
...@@ -66,7 +66,7 @@ action_prob = [0] * 4 ...@@ -66,7 +66,7 @@ action_prob = [0] * 4
agent_obs = [None] * env.get_num_agents() agent_obs = [None] * env.get_num_agents()
agent_next_obs = [None] * env.get_num_agents() agent_next_obs = [None] * env.get_num_agents()
agent = Agent(state_size, action_size, "FC", 0) agent = Agent(state_size, action_size, "FC", 0)
agent.qnetwork_local.load_state_dict(torch.load('../flatland/baselines/Nets/avoid_checkpoint15000.pth')) agent.qnetwork_local.load_state_dict(torch.load('./flatland/baselines/Nets/avoid_checkpoint15000.pth'))
demo = True demo = True
...@@ -144,7 +144,6 @@ for trials in range(1, n_trials + 1): ...@@ -144,7 +144,6 @@ for trials in range(1, n_trials + 1):
for step in range(100): for step in range(100):
if demo: if demo:
env_renderer.renderEnv(show=True) env_renderer.renderEnv(show=True)
time.sleep(0.1)
# print(step) # print(step)
# Action # Action
for a in range(env.get_num_agents()): for a in range(env.get_num_agents()):
......
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