Repository navigation
Yunfei/fix sumo cosim - #58
Open
Yunfei-Zhang wants to merge 2 commits into
Open
Yunfei-Zhang wants to merge 2 commits into
Yunfei-Zhang wants to merge 2 commits into
Conversation
SUMOFleetPyServer.py cannot be imported at all: line 24 imports run_scenarios from run_examples, but run_examples.py was moved into studies/example_study/ by 55c9d04 and this import was never updated, so the module does not exist at the repo root. Point it at run_scenarios.py, which is where the symbol actually lives and is what studies/example_study/run_examples.py itself imports. Reproduce on a clean checkout: python -c "import src.coupling.SUMO.SUMOFleetPyServer" ModuleNotFoundError: No module named 'run_examples'
SUMO's command-line -a REPLACES the <additional-files> list from the
configuration file rather than extending it. setup_sumo_simulation()
passes -a with the generated edgeData config, so every scenario's own
additional files are silently discarded: traffic-light programs, WAUT
switching, public-transport stops and schedules.
Nothing fails. The simulation runs to completion and produces
plausible-looking output, just with no signal control and no transit,
which makes this easy to miss in results.
Reproduce on any scenario whose sumocfg declares additional files:
sumo -c scenario.sumocfg -a generated.add.xml \
--save-configuration effective.cfg
effective.cfg lists only generated.add.xml.
sumocfg_utils.merge_additional_files() reads the additional files the
sumocfg declares, resolves them relative to the config's own directory
as SUMO does, and appends the generated one, preserving order and
dropping duplicates. It is kept free of FleetPy and traci imports so it
can be tested standalone.
Verified on the Ingolstadt 365 scenario over TraCI: 123 traffic lights
load after the fix and none before it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent bugs in SUMOFleetPyServer.py, one commit each.
Line 24 imports run_scenarios from run_examples, but run_examples.py moved into studies/example_study/ in 55c9d04 and the import was never updated.
python -c "import src.coupling.SUMO.SUMOFleetPyServer"
ModuleNotFoundError: No module named 'run_examples'
Repointed at run_scenarios.py, which is where the symbol lives and what studies/example_study/run_examples.py itself imports.
SUMO's -a replaces the list from the sumocfg rather than extending it. setup_sumo_simulation() passes -a with its generated edgeData config, so traffic-light programs, WAUT switching, PT stops and schedules are all discarded.
Nothing fails: the simulation runs to completion and produces plausible output, just with no signal control and no transit. Reproduce on any scenario with additional files:
sumo -c scenario.sumocfg -a generated.add.xml --save-configuration effective.cfg
effective.cfg lists only generated.add.xml.
New sumocfg_utils.merge_additional_files() reads what the sumocfg declares, resolves paths relative to the config's directory as SUMO does, and appends the generated file, preserving order and dropping duplicates. Kept free of FleetPy and traci imports so it can be tested standalone.
Verified on the Ingolstadt scenario over TraCI: 123 traffic lights load after the fix, 0 before.
Branched off current dev/merge_to_master. Touches only the two files; no study or data changes.