Main Content

openScenarioXMLImportOptions

R2026b

Specify options for customizing imported ASAM OpenSCENARIO XML files

Since R2026b

    Description

    The openScenarioXMLImportOptions object enables you to specify options when importing an ASAM OpenSCENARIO® XML files into a RoadRunner scenario.

    Creation

    Description

    options = openScenarioXMLImportOptions creates a default configuration object for importing ASAM OpenSCENARIO XML file into RoadRunner scenarios.

    options = openScenarioXMLImportOptions(PropertyName=Value) specifies properties using one or more name-value arguments.

    example

    Properties

    expand all

    Option to run a logic simplification transform after import, specified as a logical 1 (true) or 0 (false).

    By default, RoadRunner Scenario applies logic simplification when importing scenario data from .xosc files. Logic simplification is a process in which RoadRunner Scenario uses transformations on the imported scenario logic data to reduce the number of nested parallel phases in the Logic editor, which can simplify the imported scenario logic and make it easier to interpret.

    Without logic simplification, RoadRunner Scenario uses nested parallel phases to display the hierarchy of the scenario logic in the Logic editor as it is represented in the imported .xosc file. To maintain the original hierarchy of the .xosc file, such as for directly comparing elements between it and the RoadRunner scenario, specify this option as false.

    Note

    The logic simplification process does not impact the behavior of the scenario simulation.

    Examples

    collapse all

    When you import a scenario from an ASAM OpenSCENARIO XML file into RoadRunner, you can specify options for customizing the import process using the openScenarioXMLImportOptions object.

    Create a roadrunner object, specifying the path to an existing project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic tasks such as opening, closing, and saving scenes and projects.

    rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");

    Open a scenario into which to import your ASAM OpenSCENARIO XML file. Alternatively, if you do not have an existing scenario file, switch to scenario editing mode by selecting Scenario Editing from the top-right corner of the RoadRunner application.

    openScenario(rrApp,"MyScenario.rrscenario");
    Create an openScenarioXMLImportOptions object that specifies to run a logic simplification transform after import to simplify the imported scenario logic and make it easier to interpret.

    options = openScenarioXMLImportOptions(RunSimplification=1);

    Import your ASAM OpenSCENARIO XML file using the importScenario function, specifying your openScenarioXMLImportOptions object as input.

    importScenario(rrApp,"C:\RR\MyProject\MyOSC.xosc","OpenSCENARIO XML",options)

    Version History

    Introduced in R2026b