DefaultSimulator.StateListener

class StateListener implements Listener

The StateListener listens for changes in the simulation’s state. These changes can occur at any time on a continuous interval between the simulation time steps.

Fields

transitions

ArrayList<Message> transitions

A cache containing the state transition messages.

Methods

dumpMessageCache

public List<Message> dumpMessageCache()

Dumps the contents of the cache to a JSON string. Calling this method will irreversibly clear the cache. This method will return null if the cache is empty.

Returns:The contents of the cache as JSON string or null.

update

public void update(Object data)

This method is called by an Observable when its state has changed.

Parameters:
  • data – The data object that is passed from the Observable.