Hello,
saving should be finished but I suspect that the final write buffer was not
flushed.
Always call traci.close() before calling exit(). This shuts down SUMO in an
ordered fashion and allows all buffers to be flushed.

regards,
Jakob

2016-04-25 3:18 GMT+02:00 Matěj Kubička <
[email protected]>:

> Hello,
> is it possible that call to Connection.simulation.saveState() returns
> before the state is fully saved? Following call will leave invalid
> statefile :
>
>          proc = subprocess.Popen(['sumo' ...])
>          tad = traci.connect(self.port))
>          tad.simulation.saveState(self.state_fname)
>          exit()
>
> Note the exit() call right after the call to saveState(). Since python
> forks SUMO this call will kill SUMO too. If I try to open the statefile
> later SUMO itself complaints:
>
> Error: input ended before all started tags were ended; last tag started
> is 'snapshot'
>   In file '/tmp/sumo-state-55001.xml'
>   At line/column 75447/5.
>
> Best,
> Matej.
>
>
>
> On 15.3.2016 12:55, Jakob Erdmann wrote:
> > Hello,
> > traci now supports saving simulation state (although not quite as in the
> > patch).
> > See http://sumo.dlr.de/wiki/TraCI/Change_Simulation_State
> > and http://sumo.dlr.de/trac.wsgi/changeset/20191
> > regards,
> > Jakob
> >
> > 2016-03-14 8:14 GMT+01:00 Jakob Erdmann <[email protected]>:
> >
> >> Thank you very much for the patch. We will integrate this for 0.26.0 (
> >> http://sumo.dlr.de/trac.wsgi/ticket/2191)
> >>
> >> cheers,
> >> Jakob
> >>
> >> 2016-03-10 1:02 GMT+01:00 Matěj Kubička <[email protected]>:
> >>
> >>> Hello Jakob,
> >>> I cannot use --save-state.xx options as I do not know beforehand when I
> >>> will want to save the state. What I need is to be able to do it on
> request
> >>> via TraCI.
> >>>
> >>> I implemented this in SUMO 0.25 (rev 19749), see attached patch for the
> >>> changes. The parts of SUMO I was dealing with were written quite
> elegantly
> >>> and so the changes are not all that complicated (for which I am
> grateful
> >>> :-)). It now recognizes TraCI command 0x03 as a request to save the
> >>> simulation state. I invoke it from python simply as
> >>>
> >>>      def saveState(self, filename):
> >>>          self._beginMessage(0x03, 0, filename)
> >>>          self._sendExact()
> >>>
> >>> Can you make similar functionality part of mainstream SUMO/TraCI? It
> >>> would simplify things for me.
> >>>
> >>> Thank you,
> >>> Matej.
> >>>
> >>
> >
> ------------------------------------------------------------------------------
> > Transform Data into Opportunity.
> > Accelerate data analysis in your applications with
> > Intel Data Analytics Acceleration Library.
> > Click to learn more.
> > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> > _______________________________________________
> > sumo-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/sumo-devel
>
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> sumo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-devel
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
sumo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-devel

Reply via email to