Component Execution Methods

By default, a component in Pictorus will run whenever its parent component or state runs. However, the platform also supports the ability to run a component (and in turn its children) based on a desired update rate or conditionally based on a signal. These different execution methods allow components to run at varying rates across the entire model, or only run conditionally based on the state of the system. On timesteps that a component doesn't run it will not respond to changes to its inputs, and its outputs will be set to whatever value they had the last time it was run.

A component's execution method can be set in the component settings pane. You can get to this view by right-clicking on a component and selecting "Settings". Within this pane there is an "Execution Method" dropdown with three choices; Inherited, Atomic, and Conditional.

Component Execution Methods

Inherited

This is the default execution method for a component when it is created. With this setting the component will run whenever its parent runs. That parent may be another component or it could be a state.

Inherited Component example

Atomic

When execution method it set to atomic a visual indicator in the form of a small stop watch icon will appear on the top left of the component. Additionally, a second input box will appear in the settings for the desired timestep of the component. The timestep set here will be the effective timestep that the component is run at. This timestep has a few limitations, it must be greater than the timestep that its parent is running at, and it must be an integer multiple of its parent's timestep.

For example, if you had a model set to run with a 0.1 second timestep you could place a component at the top level of the model and set it to run at a timestep of 0.5 seconds. This would have the result of executing that component once every 5 timesteps of the model as a whole. In this example one could not set a timestep of less than 0.1 since the component cannot run faster than its parent. Additionally, it could not be set with a timestep of 0.25 seconds since that does not divide evenly into the parent's timestep.

Atomic execution can be used to, for example, run a different parts of a controller at different rates. A specific example would be updating a Kalman Filter at a slower rate than a PID controller that is actuating control surfaces on a UAV.

Atomic Component example

Conditional

Conditional execution allows the execution of a component and its children to be controlled by the output of other blocks in the model. When this option is set a new input will appear on top of the component. When a signal is connected to that input that block will only run in a given timestep if that signal evaluates as True. If the signal is False the component will not run.

Conditional execution can be very useful, both as a regulating mechanism (i.e. enforcing different update rates for different parts of the app), as well as for preventing execution of dangerous code (divide by zero, etc).

Conditional Component example