From 5dc688e410b46f808d26c20d9f54579e9b61e54b Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 15 Jun 2023 19:24:18 +0200 Subject: [PATCH] Add streaming update consumer model type and interface Signed-off-by: Pierre R. Mai --- doc/osi-sensor-model-packaging_spec.adoc | 4 +++- doc/spec/model_types.adoc | 5 +++++ doc/spec/streaming_update_inputs.adoc | 27 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 doc/spec/streaming_update_inputs.adoc diff --git a/doc/osi-sensor-model-packaging_spec.adoc b/doc/osi-sensor-model-packaging_spec.adoc index 9c446f8..4adb4d2 100644 --- a/doc/osi-sensor-model-packaging_spec.adoc +++ b/doc/osi-sensor-model-packaging_spec.adoc @@ -32,6 +32,8 @@ include::./spec/traffic_command_update_outputs.adoc[leveloffset=+2] include::./spec/traffic_update_outputs.adoc[leveloffset=+2] +include::./spec/streaming_update_inputs.adoc[leveloffset=+2] + == Examples include::./setup/build_install_example.adoc[leveloffset=+2] @@ -39,4 +41,4 @@ include::./setup/build_install_example.adoc[leveloffset=+2] include::./misc/example.adoc[leveloffset=+2] endif::[] -:!antora-mapping: \ No newline at end of file +:!antora-mapping: diff --git a/doc/spec/model_types.adoc b/doc/spec/model_types.adoc index 2065daa..3882bb7 100644 --- a/doc/spec/model_types.adoc +++ b/doc/spec/model_types.adoc @@ -26,6 +26,11 @@ Traffic participant models consume `osi3::SensorView` as input and produce `osi3 They may also consume `osi3::TrafficCommand` as input to allow control by a scenario engine or other coordinating function. They may also produce `osi3::TrafficCommandUpdate` as output to allow status responses to such control messages. +Streaming update consumer models:: +This model type receives a streaming update input for further processing. +Examples of this model type can be visualization, evaluation, or logging modules. +Streaming update consumer models consume `osi3::StreamingUpdate` as input; if they produce any output, it is currently not specified as part of this standard. + All models may also consume a global `osi3::GroundTruth` parameter during initialization. Complex models may combine various aspects of the above model types. diff --git a/doc/spec/streaming_update_inputs.adoc b/doc/spec/streaming_update_inputs.adoc new file mode 100644 index 0000000..5d0f009 --- /dev/null +++ b/doc/spec/streaming_update_inputs.adoc @@ -0,0 +1,27 @@ +ifndef::include-only-once[] +:root-path: ../ +include::{root-path}_config.adoc[] +endif::[] += Streaming update inputs + +Streaming update inputs are present in streaming update consumer models. +They provide incremental updates of environmental simulation state in a way that is suitable for low latency applications. + +**Prefix** + +Streaming update inputs shall be named with the following prefix: + +[source,protobuf] +---- +OSMPStreamingUpdateIn +---- + +**Rules** + +* If only one streaming update input is configured, the prefix shall only be `OSMPStreamingUpdateIn`. +* If more than one streaming update input is configured, the prefix shall be extended by an array index designator, for example `OSMPStreamingUpdateIn[1]` and `OSMPStreamingUpdateIn[2]`. +* Array indices shall start at 1 and shall be consecutive. +* Each streaming update input shall be defined as a notional discrete binary input variable with `@causality="input"` and `@variability="discrete"`. +* The MIME type of the variable shall specify the `type="StreamingUpdate"` as part of the MIME type parameters. +* Streaming updates shall be encoded as `osi3::StreamingUpdate`. +* The guaranteed lifetime of the traffic command protocol-buffer pointer provided as input to the FMU shall be from the time of the call to `fmi2SetInteger` that provides those values until the end of the following `fmi2DoStep` call.