Memory Buffered Animation Sink
An AnimationSink that holds every emitted event in memory for the duration of a replication, then hands the whole batch to flush when the replication ends.
This sink does no input/output itself: it is deliberately decoupled from how events are written. The flush function decides what "write" means (append to a .atf file, push to a renderer, accumulate in a test), which keeps this class trivial to test and free of any file dependency. Because all events for a replication are gathered before flush runs, there is zero I/O on the simulation thread during the replication — the trade-off is memory proportional to the number of events in one replication.
Threading: like every sink, emit is called on the simulation thread. This implementation is single-threaded and performs no synchronization.
Parameters
invoked once at the end of each replication with the replication number and the events collected during it. The list passed to flush is the sink's live buffer and is cleared as soon as flush returns, so the callback must consume it synchronously (copy it if it needs to keep it).
Properties
Functions
Flushes any events emitted after the last replication ended (e.g. a final experiment-level marker), so nothing is left unwritten. Attributed to the last replication that ended.
Flushes the events collected during replicationNumber and empties the buffer so the next replication starts clean.