Main Content

onSimulationStep

Class: sim3d.scenario.ActorBehavior
Namespace: sim3d.scenario

Specify code to run at each time step

Since R2023b

Syntax

onSimulationStep(self, actorSimulation)

Description

onSimulationStep(self, actorSimulation) specifies code to run at each simulation time step. Use this method to define the behavior of your RoadRunner actor and its Simulink® 3D Animation™ visualization.

Input Arguments

expand all

Actor behavior object, specified as a sim3d.scenario.ActorBehavior object. For more information, see sim3d.scenario.ActorBehavior.

RoadRunner actor information, specified as an ActorSimulation object. For more information, see ActorSimulation.

Attributes

AccessProtected

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Use this code to define the onSimulationStart method in your sim3d.scenario.ActorBehavior subclass.

methods(Access = protected)
  function onSimulationStep(self, actorSimulation)
    % Insert step tasks
  end  
end

Version History

Introduced in R2023b