Create a class of listener. A listener monitors the trial while checking condition of pre-defined milestones. Actions are triggered and executed automatically.
Methods
Method add_milestones()
register milestones with listener. Order in ...
matter
as they are scanned in that order. It is user's responsibility
to use reasonable order when calling this function, otherwise,
the result of Listener$monitor()
can be problematic.
Method monitor()
scan, check, and trigger registered milestones.
Milestones are triggered in the order when calling
Listener$add_milestones
.
Method reset()
reset all milestones registered to the listener. Usually, this is called before a controller can run additional replicates of simulation.