Checkpointing occurs via object serialization. MASON (nor Java)
wouldn't know where in your step() method the serialization occurred
because the position within the method is not preserved by
serialization, only the values of the members.
So stopping/checkpointing/serializing in the top-level loop is where
you checkpoint. See Section 4.2 The Big Loop in the manual:
Also, your statements about checkpointing --" I am doing is
checkpointing the simulation on every X steps (for example, on every 5
steps, application saves the simulation). This automatic checkpoint is
important for me."
"is important to verify the current step, to
decide to save or not that moment."
Seem to be contradictory. If you want to dynamically decide outside
the main loop when to checkpoint, then you'll need to expose your
simulation objects' states to make that determination via some method
or public access to the members you'll use.
On Tue, Sep 11, 2012 at 2:02 PM, Daniel Gribel <[log in to unmask]> wrote:
> Sorry, my own class implements Steppable.
> I am running a GUI too.
> I am calling writeToCheckpoint() method, from SimState, inside that class
> which implements Steppable.
> Do you know why is not possible to try checkpointing inside step() method?