1
0
mirror of https://github.com/Ahp06/SUMO_Emissions.git synced 2024-11-24 04:26:29 +00:00

Find the sumocfg file automatically in the simdir

This commit is contained in:
Thibaud Gasser 2019-02-06 14:20:45 +01:00
parent 1d5c0ec576
commit a239c51a1b

View File

@ -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]