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:
parent
1d5c0ec576
commit
a239c51a1b
@ -85,7 +85,10 @@ class Config:
|
|||||||
:param simulation_dir: The path to the simulation directory
|
:param simulation_dir: The path to the simulation directory
|
||||||
:return:
|
: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)
|
sumo_binary = os.path.join(os.environ['SUMO_HOME'], 'bin', self._SUMOCMD)
|
||||||
self.sumo_cmd = [sumo_binary, "-c", self._SUMOCFG]
|
self.sumo_cmd = [sumo_binary, "-c", self._SUMOCFG]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user