endSimulation

Signals the iterative-process loop to stop after the current replication has finished.

This method operates at the experiment level: it sets a flag that the outer replication loop checks between replications. The Executive's inner event loop never inspects this flag while it is dispatching events.

Do not call from within a model event handler, process step, or any ModelElement lifecycle override while a replication is executing. On an infinite-horizon model the call will be silently ignored and the replication will hang indefinitely.

To end the current replication early from within model code use ModelElement.stopReplication instead.

Parameters

msg

optional message recorded as the reason for stopping

Throws

if the Executive is currently dispatching events, i.e. if called from within model code during a replication