-
Notifications
You must be signed in to change notification settings - Fork 181
faq 127369225
by Jishnu Narayan on 2017-12-01 11:30:02
Dear all,
I want to write some additional output data for each iteration. For this I need to get the number of the ongoing iteration. How can I get the number of the current iteration and the iteration that have just been finished?
Thanks!
by Marcel Rieser on 2017-12-01 11:48:49
You should use a ControlerListener
, specifically an IterationEndsListener
that gets called when an iteration ends. When your listener is called, you get the current/ending iteration as an Argument and can use it to write out your data. Have a look at the following code example to see how ControlerListeners work:
https://github.com/matsim-org/matsim-code-examples/tree/master/src/main/java/tutorial/programming/example07ControlerListener
by Jishnu Narayan on 2018-05-18 09:31:49
Hello Marcel,
The link that you have given is no longer available. Is there any other example out there?
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq