Simulation Observer - adolgert/CTDE.jl GitHub Wiki
Every time the simulation determines a next time and transition, it calls an observer and calls it with this signature.
StateObserver(state::Array{Int,1}, affected_keys, clock_name, time::Float64)
state
is the state of the system.affected_keys
are those substates which were affected when the last transition fired.clock_name
is the name given to that transition.time
is the time at which that transition happened.- Returns: The observer returns a boolean indicating whether the simulation may continue.
In practice, this function is a closure which adds data to a list of data, or writes that list to disk.