Main Content

ActorSimulation

Access and modify runtime specifications of actor

Since R2022a

    Description

    An ActorSimulation object represents an actor in a scenario simulation. Use an ActorSimulation object to:

    • Access and modify the runtime attributes of an actor.

    • Access the actions of an actor in the current simulation time step.

    Creation

    Retrieve the list of ActorSimulation objects from a simulation by using the get function of a ScenarioSimulation object. If required, you can then retrieve specific actors.

    Object Functions

    convertToStructConvert actor to MATLAB structure
    getGet scenario or static attribute of actor
    getActionGet actions associated with actor
    getAttributeGet runtime attribute of actor
    receiveEventReceive event from scenario
    sendEventSend event to scenario
    setAttributeSet runtime attribute of actor
    Simulink.ActorSimulation.createMATLABStructCreate MATLAB structure for bus object for RoadRunner
    Simulink.ActorSimulation.loadLoad built-in RoadRunner bus definitions into MATLAB workspace

    Examples

    collapse all

    Create Sim, a ScenarioSimulation object.

    rrApp = roadrunner("C:\RoadRunnerProject");
    openScenario(rrApp,"TrajectoryCutIn");
    Sim = createSimulation(rrApp);

    Start the simulation.

    set(Sim,"SimulationCommand","Start");

    Get all actors while the simulation runs.

    actorSim = get(Sim,"ActorSimulation");

    Get the first actor only.

    actorOne = actorSim(1);

    Version History

    Introduced in R2022a