メインコンテンツ

ActorSimulation

MATLAB での RoadRunner Scenario アクターの実行時の仕様へのアクセスと変更

R2022a 以降

    説明

    ActorSimulation オブジェクトは、シナリオ シミュレーションにおけるアクターを表します。ActorSimulation オブジェクトは以下に使用します。

    • アクターの実行時の属性にアクセスして変更する。

    • 現在のシミュレーション タイム ステップにおけるアクターのアクションにアクセスする。

    作成

    ScenarioSimulation オブジェクトの get 関数を使用して、シミュレーションから ActorSimulation オブジェクトのリストを取得します。必要に応じて、その後に特定のアクターを取得できます。

    オブジェクト関数

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

    すべて折りたたむ

    ScenarioSimulation オブジェクト Sim を作成します。

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

    シミュレーションを開始します。

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

    シミュレーションの実行中にすべてのアクターを取得します。

    actorSim = get(Sim,"ActorSimulation");

    最初のアクターのみを取得します。

    actorOne = actorSim{1};

    バージョン履歴

    R2022a で導入