Commit 119356f9 authored by nilabha's avatar nilabha
Browse files

Merge branch 'flatland-paper-baselines' into 'master'

Flatland paper baselines

See merge request !18
parents 9a904072 97fc8574
Pipeline #5383 passed with stage
in 4 minutes and 26 seconds
...@@ -2,7 +2,7 @@ import logging ...@@ -2,7 +2,7 @@ import logging
import gym import gym
import numpy as np import numpy as np
from flatland.envs.malfunction_generators import no_malfunction_generator, malfunction_from_params from flatland.envs.malfunction_generators import no_malfunction_generator, malfunction_from_params, MalfunctionParameters
from flatland.envs.rail_env import RailEnv from flatland.envs.rail_env import RailEnv
from flatland.envs.rail_generators import sparse_rail_generator from flatland.envs.rail_generators import sparse_rail_generator
from flatland.envs.schedule_generators import sparse_schedule_generator from flatland.envs.schedule_generators import sparse_schedule_generator
...@@ -59,11 +59,11 @@ class FlatlandSingle(gym.Env): ...@@ -59,11 +59,11 @@ class FlatlandSingle(gym.Env):
malfunction_generator = no_malfunction_generator() malfunction_generator = no_malfunction_generator()
if {'malfunction_rate', 'min_duration', 'max_duration'} <= self._config.keys(): if {'malfunction_rate', 'min_duration', 'max_duration'} <= self._config.keys():
stochastic_data = { stochastic_data = MalfunctionParameters(
'malfunction_rate': self._config['malfunction_rate'], malfunction_rate=self._config['malfunction_rate'],
'min_duration': self._config['malfunction_min_duration'], min_duration=self._config['malfunction_min_duration'],
'max_duration': self._config['malfunction_max_duration'] max_duration=self._config['malfunction_max_duration']
} )
malfunction_generator = malfunction_from_params(stochastic_data) malfunction_generator = malfunction_from_params(stochastic_data)
speed_ratio_map = None speed_ratio_map = None
......
...@@ -2,7 +2,8 @@ import logging ...@@ -2,7 +2,8 @@ import logging
from pprint import pprint from pprint import pprint
import gym import gym
from flatland.envs.malfunction_generators import malfunction_from_params, no_malfunction_generator from flatland.envs.malfunction_generators import malfunction_from_params, no_malfunction_generator, \
MalfunctionParameters
# from flatland.envs.rail_env import RailEnv # from flatland.envs.rail_env import RailEnv
from envs.flatland.utils.gym_env_wrappers import FlatlandRenderWrapper as RailEnv from envs.flatland.utils.gym_env_wrappers import FlatlandRenderWrapper as RailEnv
...@@ -80,11 +81,11 @@ class FlatlandSparse(FlatlandBase): ...@@ -80,11 +81,11 @@ class FlatlandSparse(FlatlandBase):
malfunction_generator = no_malfunction_generator() malfunction_generator = no_malfunction_generator()
if {'malfunction_rate', 'malfunction_min_duration', 'malfunction_max_duration'} <= self._config.keys(): if {'malfunction_rate', 'malfunction_min_duration', 'malfunction_max_duration'} <= self._config.keys():
stochastic_data = { stochastic_data = MalfunctionParameters(
'malfunction_rate': self._config['malfunction_rate'], malfunction_rate=self._config['malfunction_rate'],
'min_duration': self._config['malfunction_min_duration'], min_duration=self._config['malfunction_min_duration'],
'max_duration': self._config['malfunction_max_duration'] max_duration=self._config['malfunction_max_duration']
} )
malfunction_generator = malfunction_from_params(stochastic_data) malfunction_generator = malfunction_from_params(stochastic_data)
speed_ratio_map = None speed_ratio_map = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment