Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Scenario Application



scenario
Function execute a scenario defined in an XLSX file
Distribution scenarioEngine-bin-.zip
Jar files scenarioEngine.jar
Modules scenario
Namespace http://dassault-aviation.com/scenarioEngine

Provided services Provided datas through module configuration
http://dassault-aviation.com/scenarioEngine:scenarioEngineTicks
http://dassault-aviation.com/scenarioEngine:setScenario
http://dassault-aviation.com/scenarioEngine:setState

Required services none
Optional properties scenario
checkDatas
increment
speed
acceptNewLines
popupErrors
autoStart
guiPosition

Image scenarioPanelthumb
The built-in Scenario application allows to execute a scenario defined in an XLSX file. This scenario will update the values for datas defined for one or several publish Services or event Services.

Application properties

The application configuration has the following properties, all optional:
  • "scenario": the optional path of the XLSX scenario. It is possible to change the scenario to use during runtime
  • "autoStart": true if the scenario reading autostart at the start of the framework
  • "checkDatas": the optional boolean property setting if a warning should be emitted for datas present in the XLSX file which do not exist in any provided publish service. The default value is true
  • "acceptNewLines": the optional boolean property setting if array elements can be separated by new lines instead of ";" (semi-colon). The default value is true
  • "increment": the optional step increment in seconds of the scenario runtime (default is 1 second)
  • "speed": the optional speed of the scenario runtime (default is 1)
  • "popupErrors": specify if the parsing errors of the Scenario should be presented on a popped-up window (default is false)
  • "guiPosition": the x and position of the player window. The format is <x position;>;<y position;

Provided services

External services

Only the publish Services or event Services for which the Scenario Module is a provider will be taken into account. For example:
      <interfaces>
         <push service="acDatas"/>
         <eventSend service="fuelState"/>
      </interfaces>

Built-in services

The built-in scenario services are defined in the http://dassault-aviation.com/scenarioEngine namespace. The definitions of the Services are:
      <namespace uri="http://dassault-aviation.com/scenarioEngine">
         <event name="scenarioEngineTicks">
            <data name="tick" type="int" />
            <data name="time" type="float" />
         </event>
         <event name="setState">
            <data name="state" type="scenarioState" />
            <data name="time" type="float" />
         </event>
         <event name="setListener">
            <data name="time" type="float" />
         </event>
         <event name="setScenario">
            <data name="scenario" type="scenarioFile" />
            <data name="autoStart" type="bool" />
         </event>
      </namespace>

ScenarioEngineTicks service

The scenarioEngineTicks service allows to send the ticks of the scenario.

Scenario definition

The scenario itself is an XLSX file for which each line represent the values of one data. It must contain the following columns:
  • Column A: the data description, only used to document the content of the scenario. It is unused in the parsing
  • Column B: the data name. It must represent the name of a data in one of the provided Services. Note that the name can have two formats:
    • Name without a dot (example: spd_value): refer to a data with this exact name in any provided Service
    • Name with a dot (example: scenario.spd_value): the first part of the name the provided Service with this name, the second part of the name refer to a data with this exact name in this Service
  • From Column C: values of the data for each time step defined of the scenario

scenario

Time steps specification

By default time steps represent seconds. It is possible to change the value in seconds this represents by setting the "increment" property, and to speed-up the simulation by setting the "speed" property.

Data constraints


  • Each data defined in the scenario must be defined for one of the provided Services. Data which do not exist will be ignored[1]
    The Data will be silently ignored if the "checkDatas" property is set to false, else a warning will be emitted during the Scenario parsing
  • The datas defined in the scenario must have a simple type, array type, or structure type. Arrays whose elements are also arrays are not supported
  • The value of a data must be defined for the first time step

Data value parsing

The first line with a numeric value in Column C will signal the beginning of the scenario definition with the values for the times: Each Cell in the subsequent columns will specify one time step[2]
Note that rows with nothing in Column B will be ignored, which allows to comment the content of the scenario
. For example in the following scenario, we have values defined for the time steps: 0, 1, 2, ...
scenario2
  • If a cell does not contain anything, it means that the value of the data did not change since the last defined time

Array values parsing

Cells which represent array values can be defined as list of elements separated by a new line or a ";" (semi-colon). Note that:
  • separating values by new lines is only allowed if the acceptNewLines property is set to true
It is also possible to define them with one element per each line, separated by new lines.

Example with semi-colon

For example, in the following case on time 0:
scenarioArray
  • The arrayInt int array has 3 elements: [1, 2, 3]
  • The arrayFloat float array has 3 elements: [1.2, 2.2, 3.2]
  • The arrayBool boolean array has 3 elements: [true, true, false]

Example with new lines

The following example is equivalent to the previous one:
scenarioArray2
  • The arrayInt int array has 3 elements: [1, 2, 3]
  • The arrayFloat float array has 3 elements: [1.2, 2.2, 3.2]
  • The arrayBool boolean array has 3 elements: [true, true, false]

Publish services datas

For publish Services, the scenario considers that datas are updated at each time step. Depdending on the data type, the data value can be interpolated between each time step.

Publish services data value parsing

For publish services, data values are interpolated between time steps:

  • If a cell contains a value:
    • If the data is an integer, a long, a short, a char, a float or a double, the scenario will interpolate the values between the two time steps. Note that it will not be the case fore Continuous Datas and types
    • If the data is a string, a boolean or an enumerate, the scenario will affect the specified value
For example in the previous scenario:
  • "spd_value" will have the value 140 from 0 seconds to 3 seconds, then will be interpolated from 140 to 150 fron 3 seconds to 4 seconds, then will keep the value 150
  • "cmd_spd_state" will have the value "FMS" from 0 seconds to 3 seconds, then will have the value "MAN"
  • "mach_visible" will have the value "false" from 0 seconds to 3 seconds, then will have the value "true"

Limitation on interpolation

Main Article: Continuous Datas

The module does not perform any interpolation on continuous datas, exactly as if they were enumerations.

Publish services array values parsing

Arrays of integer, long, short, char, float or double elements will be interpolated as for simple type datas.

Continous data parsing

By default, if the data is a number (an integer, a long, a short, a byte, a float or a double), the scenario will interpolate the values between the two time steps. However, non Continuous Datas and types will not be interpolated by the scenario.

Event services datas

For event Services, the scenario considers that the event service is only sent for one time step if there is at least one data which value is set for this time step.

Scenario execution

After the framework has been started, the following panel will appear for the Scenario application:
scenarioPanel
The panel has the following buttons:
  • scenarioOpen : Open a new Scenario
  • scenarioPlay : Play a new Scenario (excludive with the Pause button). If you click on this button when the scenario is playing, the execution will be paused
  • scenarioPause : Pause a playing scenario. Tu unpause and continue the execution, click again on the button
  • scenarioStep : Execute one step in the Scenario
  • scenarioRewind : Rewind the execution Scenario to the beginning of the Scenario
  • scenarioPlay : Stop the execution of the Scenario

It also has two indicators:
  • scenarioTime : shows the time in seconds since the beginning of the scenario
  • scenarioHeart : the heart flashes each time a step is performed

Execution heartRate

The scenarioTime shows the time in seconds since the beginning of the scenario, which means that you won't see it changing every time (for example, if you apply Execute one step and the "increment" value is less than 1). The scenarioHeart icon will show each time a step is performed:
scenarioPanelHeart

Example

      <application name="scenario" id="12" >
         <deployment>
            <lib url="scenarioEngine.jar" />
         </deployment>
         <modules>
            <module name="scenario" id="1" >
               <interfaces>
                  <push service="scenario" attach="attach"/>
               </interfaces>
            </module>
         </modules>
      </application>

Emitting scenario ticks

By default the engine does not send anything for ticks, but if Scenario module emits the http://dassault-aviation.com/scenarioEngine:scenarioEngineTicks event service, the engine will invoke the scenarioEngineTicks service for each tick of the scenario before invoking the output services for the scenario datas.

The associated service must have the following definition:
      <namespace uri="http://dassault-aviation.com/scenarioEngine">
        <event name="scenarioEngineTicks">
           <data name="tick" type="int" />
           <data name="time" type="float" />
        </event>
      </namespace>

Setting the scenario file

It is possible to set the scenario file by another service rather than by the GUI, if the Scenario module receives the Scenario module http://dassault-aviation.com/scenarioEngine:setScenario event service.

The associated service must have the following definition:
      <namespace uri="http://dassault-aviation.com/scenarioEngine">
        <event name="setScenario">
           <data name="scenario" type="scenarioFile" />
           <data name="autoPlay" type="bool" />
        </event>
      </namespace>

Changing the state of the engine

It is possible to change the state of the scenario engine by the http://dassault-aviation.com/scenarioEngine:setState event service.

The associated service must have the following definition:
      <namespace uri="http://dassault-aviation.com/scenarioEngine">
        <event name="setState">
           <data name="scenarioState" type="scenarioState" />
           <data name="time" type="float" />
        </event>
      </namespace>
with the following definition for the scenarioState data:
      <enumType name="scenarioState" >
         <enumValue name="PLAY" />
         <enumValue name="PAUSE" />
         <enumValue name="STOP" />
      </enumType>

Notes

  1. ^ The Data will be silently ignored if the "checkDatas" property is set to false, else a warning will be emitted during the Scenario parsing
  2. ^ Note that rows with nothing in Column B will be ignored, which allows to comment the content of the scenario

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence