From a239c51a1bbb4a55e5ecd8753fa327551e0216bb Mon Sep 17 00:00:00 2001 From: Thibaud Date: Wed, 6 Feb 2019 14:20:45 +0100 Subject: [PATCH] Find the sumocfg file automatically in the simdir --- sumo_project/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sumo_project/config.py b/sumo_project/config.py index 1bb3f64..996a436 100644 --- a/sumo_project/config.py +++ b/sumo_project/config.py @@ -85,7 +85,10 @@ class Config: :param simulation_dir: The path to the simulation directory :return: """ - self._SUMOCFG = f'files/simulations/{simulation_dir}/osm.sumocfg' + simdir = f'files/simulations/{simulation_dir}/' + for f in os.listdir(simdir): + if f.endswith('.sumocfg'): + self._SUMOCFG = os.path.join(simdir, f) sumo_binary = os.path.join(os.environ['SUMO_HOME'], 'bin', self._SUMOCMD) self.sumo_cmd = [sumo_binary, "-c", self._SUMOCFG]