Skip to content
Snippets Groups Projects
Commit f380125f authored by Erik Nygren's avatar Erik Nygren :bullettrain_front:
Browse files

Update multi_agent_inference.py

parent 805d9d73
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ from collections import deque
import numpy as np
import torch
from flatland.envs.malfunction_generators import malfunction_from_params
from flatland.envs.malfunction_generators import malfunction_from_params, MalfunctionParameters
from flatland.envs.observations import TreeObsForRailEnv
from flatland.envs.predictions import ShortestPathPredictorForRailEnv
from flatland.envs.rail_env import RailEnv
......@@ -37,10 +37,11 @@ n_agents = 10
observation_builder = TreeObsForRailEnv(max_depth=2)
# Use a the malfunction generator to break agents from time to time
stochastic_data = {'malfunction_rate': 8000, # Rate of malfunction occurence of single agent
'min_duration': 15, # Minimal duration of malfunction
'max_duration': 50 # Max duration of malfunction
}
stochastic_data = MalfunctionParameters(malfunction_rate=10000, # Rate of malfunction occurence
min_duration=15, # Minimal duration of malfunction
max_duration=50 # Max duration of malfunction
)
# Custom observation builder
......
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