Main Content

reportDiagnostic

Report information, warning or error message during scenario simulation

Since R2022a

    Description

    example

    reportDiagnostic(ss,MessageType,MessageString) reports a diagnostic message MessageString of MessageType: information, warning or error for the scenario simulation ss. The diagnostic message is displayed in the output window of RoadRunner Scenario.

    Examples

    collapse all

    Create ss, a ScenarioSimulation object.

    rrApp = roadrunner('C:\Project\TestHighwayRoute'); 
    openScenario(rrApp,'myScenario1'); 
    ss = createSimulation(rrApp); 

    Start the simulation.

    set(ss, 'SimulationCommand','Start')

    Report a warning during the simulation.

    reportDiagnostic(ss, 'Warning','Vehicle A is running a red light!')

    Input Arguments

    collapse all

    RoadRunner Scenario simulation, specified as a ScenarioSimulation object. The diagnostic message is reported for this simulation.

    Example: reportDiagnostic(ss, 'Warning','Vehicle A is running a red light!')

    Type of diagnostic message to be displayed in the output window of RoadRunner Scenario, specified as one of these string values.

    • Information — Information message type. A reported information message does not affect progress of the simulation.

    • Warning — Warning message type. A reported warning does not affect progress of the simulation.

    • Error — Error message type. A reported error causes the simulation to stop.

    Diagnostic message to be displayed in the output window of RoadRunner Scenario, specified as a string or character vector.

    Example: 'Vehicle A is running a red light!'

    Version History

    Introduced in R2022a