Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulation stop before the end (lastIteration = 500) #1193

Open
eBimPy opened this issue Dec 31, 2024 · 4 comments
Open

Simulation stop before the end (lastIteration = 500) #1193

eBimPy opened this issue Dec 31, 2024 · 4 comments

Comments

@eBimPy
Copy link

eBimPy commented Dec 31, 2024

Hello,
I tried to run a simulation in eqasim-java for synthetic data ile-de-france. in the configuration file I set lastIteration = 500 but the simulation often stops at iteration 85, 86, 87 without reaching the requested 500.
for information: I set lastIteration = 50 to see and this time the simulation went to the end.
In the log file I have this error:

2024-12-19T12:09:25,886 INFO CountsWriterV2:45 Write Counts to simulation_output/ile-de-france-0.1pct/output_counts.xml.gz
2024-12-19T12:09:25,943 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.matsim.analysis.ModeChoiceCoverageControlerListener with priority 0.0
2024-12-19T12:09:25,943 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.matsim.analysis.ScoreStatsControlerListener with priority 0.0
2024-12-19T12:09:25,943 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.matsim.analysis.IterationTravelStatsControlerListener with priority 0.0
2024-12-19T12:09:25,943 INFO PersonWriter:36 Writing all Persons to personscsv
2024-12-19T12:09:26,131 INFO PersonWriter:54 ...done
2024-12-19T12:09:26,131 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.matsim.analysis.LinkStatsControlerListener with priority 0.0
2024-12-19T12:09:35,514 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.matsim.contribs.discrete_mode_choice.modules.UtilitiesWriterHandler with priority 0.0
2024-12-19T12:09:35,535 INFO ControlerListenerManagerImpl:135 calling notifyShutdown on org.eqasim.core.simulation.analysis.AnalysisOutputListener with priority 0.0
2024-12-19T12:09:35,564 INFO ControlerListenerManagerImpl:138 all ControlerShutdownListeners called.
2024-12-19T12:09:35,564 INFO MatsimRuntimeModifications:103 S H U T D O W N --- shutdown completed.
2024-12-19T12:09:35,564 INFO OutputDirectoryLogging:172 closing the logfile, i.e. messages sent to the logger after this message are not written to the logfile.

Can someone explain to me where S H U T D O W N --- shutdown completed comes from.

Thanks

@sebhoerl
Copy link
Contributor

sebhoerl commented Jan 5, 2025

Hello, the Java part of eqasim standardizes and configures MATSim for the available use cases of Paris, California, Sao Paulo, etc. The default ConvergenceCriterion in MATSim stops at the iteration that is indicated as lastIteration in the config. In eqasim, we define a more intelligent ConvergenceCriterion which checks the slope of the mode shares graphs and stops the simulation once the slope falls under a configurable threshold (eqasim:convergence module in the coniguration file). This way, we make sure that the simulation stops at a well-defined state. The lastIteration config only acts as an upper bound.

@kainagel
Copy link
Member

kainagel commented Jan 5, 2025

For people who use this: one needs to be careful that this does not interact with scheduled annealing. If scheduled annealing reduces the replanning rate over the iterations, then it is clear that the slope gets smaller, but it does not say anything about convergence. We do not want to repeat the errors that earlier researchers made in static assignment (e.g. use MSA and then stop if the change rate falls underneath a fixed threshold).

@eBimPy
Copy link
Author

eBimPy commented Jan 7, 2025

Hello,
First, thank you for your quick and clear answer. Do you have any documentation or a link on how the convergence slope is calculated?
Thanks

@sebhoerl
Copy link
Contributor

sebhoerl commented Jan 7, 2025

Not yet, but the code is here: https://github.com/eqasim-org/eqasim-java/blob/develop/core/src/main/java/org/eqasim/core/simulation/termination/EqasimTerminationCriterion.java

Would be good to have an optional implementation of this in matsim-libs, something to keep in mind for the next developer meeting.

@kainagel Yes, this is a good point. Btw, I emailed you on a relatively urgent matter, just a quick pointer in case you haven't seen it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants