Skip to main content

End Events

Icon​

end_event_tb.svg

Function​

An end event destroys the Trigger to terminate the current process execution. It signifies the end of a process.

Key Points​

Graphical Modeling Syntax​

  • The End Event should be placed within the process.
  • Every process should have at least one End Event, but can also have multiple End Events.

Working Mechanism​

  • Triggers will be destroyed when they reach any End Event in a process.
  • Once all Triggers are destroyed, the model run will end prematurely, regardless of whether the maximum Tick has been reached.
  • End events have no data output.

Types of End Events​

Normal End Events​

A Normal End Event signifies the end of the current run of a process which is triggered by the arrival of the Trigger at the End Event.

Terminate Events​

A Terminate Events, once triggered, will halt the entire simulation run.

Tip

Terminate Events are typically used when there's no need to continue simulating once a specific extreme condition is met.

  • For instance, in designing a token economy system for a Web3 protocol, the simulation immediately terminates when the protocol's market value falls to zero.
  • In a grassland ecosystem simulation, the simulation ends immediately when the entire sheep population goes extinct.

Setup Methods​

First, choose the event type, Normal End Event or Terminate Event. Details for each type are provided below.

EndEvents_image2.png

Normal End Events​

endEvent_finish.svg

If you choose the Normal End Event, no settings are required.

Terminate Events​

endEvent.svg

  • Tips Setting

EndEvents_image5.png

  • Once checked, you can customize the message you would like the system to display when the Terminate Event is triggered. Simply enter your message text in the input box.

  • When Terminate is triggered, this message will appear in the system's temporary popup and the output information in the Console.

    EndEvents_image6.png

    EndEvents_image7.png

Example​

Model Example

The model is set to run for a maximum of 100 Ticks. Starting from the first Tick, the Count variable (initially set to 0) increases by 1 each Tick. When the Count exceeds 10, a Terminate Event is triggered, and the message "Exceed Limit!" is printed. As a result, the model runs for a total of 11 Ticks.