Skip to content

Commit

Permalink
Move Clock dependency info to attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer committed Mar 25, 2021
1 parent 50012f6 commit d77d194
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/2_2_common_mechanisms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ In some clock semantics (e.g. <<MLS12>>), a clocked variable has a value only wh
However, <<get-and-set-variable-values,`fmi3Get{VariableType}`>> will return the value computed at the last Clock activation time.
Before the first Clock tick, clocked variables have their initial value.

The association between <<clocked-variable,clocked variables>> and their <<Clock,Clocks>> is defined by the <<model-dependencies,model dependency>> elements <<ClockElement>>.
The association between <<clocked-variable,clocked variables>> and their <<Clock,Clocks>> is defined by the attribute <<clocks>>.
<<clocked-variable,Clocked variables>> can depend on multiple Clocks.
_[For example, a global counter could be incremented by multiple tasks, each controlled by a different Clock.]_

Expand Down
32 changes: 12 additions & 20 deletions docs/2_4_common_schema.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1077,12 +1077,19 @@ The default value of this attribute is `false`.
|
[[previous,`previous`]]
If present, this variable is a <<ClockedState>> and this attribute is a value reference to the variable with the previous value.
Only clocked variables (they are listed in at least one of the <<clockedVariables>> lists) may have the <<previous>> attribute.
Only clocked variables (i.e. variables with the attribute <<clocks>>) may have the <<previous>> attribute.
Only variables with <<variability,`variability == discrete`>> may have a previous value.

_[For example, if `previous == 3` for variable `8`, then variable `3` is the previous value of variable `8`. See also <<fmi3UpdateDiscreteStates>>._
_Note: This is reverse compared to the <<derivative>> attribute.]_

|`clocks`
|
[[clocks,`clocks`]]
If present, this variable is clocked.
The value of <<clocks>> is a list of value references of <<Clock>> variables this variable depends on.
Only discrete variables can have this attribute.
_[More rigorous importers requiring a variable to be dependent on a single clock can reject FMUs violating this restriction.]_
|====

If <<initial>> is not present, its value is defined by <<table-definition-initial>> based on the values of <<causality>> and <<variability>> (default [.underline]#underlined#):
Expand Down Expand Up @@ -1690,8 +1697,8 @@ latexmath:[{\dot{\mathbf{x}_c} := \mathbf{f}_{\mathit{der}}(\mathbf{x}_c, \mathb
|`ClockedState`
|
[[ClockedState,`<ClockedState>`]]
A <<ClockedState>> is part of the discrete state of a model partition and represented by a <<ClockElement,clocked>> variable.
To which clock or clocks it belongs is described in <<ClockElement>>.
A <<ClockedState>> is part of the discrete state of a model partition and represented by a clocked variable.
To which Clock or Clocks it belongs is described by the attribute <<clocks>>.
Each <<ClockedState>> must have the attribute <<previous>> to represent the previous value of this <<ClockedState>>.
All <<ClockedState,clocked states>> must have <<variability,`variability == discrete`>>.

Expand Down Expand Up @@ -1735,20 +1742,11 @@ _The ordering of the variables in this list is defined by the exporting tool.]_

For Co-Simulation, elements <<EventIndicator>> are ignored.
_[If an FMU supports both Model Exchange and Co-Simulation, then the <<EventIndicator>> elements might be present, since it is needed for Model Exchange.]_

|`Clock`
|
[[ClockElement,`<Clock>`]]
List of all clocks and their clocked variables.
All variables referenced by these lists must have <<variability,`variability == discrete`>>.
A clocked variable my depend on multiple clocks and may therefore be listed in multiple <<ClockElement>> elements.
_[More rigorous importers requiring a variable to be dependent on a single clock can reject FMUs violating this restriction.]_

|====

Elements <<Output>>, <<ContinuousStateDerivative>>, <<ClockedState>>, <<InitialUnknown>>, <<EventIndicator>> and <<ClockElement>> have (partially) the following attributes:
Elements <<Output>>, <<ContinuousStateDerivative>>, <<ClockedState>>, <<InitialUnknown>>, and <<EventIndicator>> have (partially) the following attributes:

.<<Output>>, <<ContinuousStateDerivative>>, <<ClockedState>>, <<InitialUnknown>>, <<EventIndicator>> and <<ClockElement>> attribute details.
.<<Output>>, <<ContinuousStateDerivative>>, <<ClockedState>>, <<InitialUnknown>>, and <<EventIndicator>> attribute details.
[[table-output-der-initialUknown-details]]
[cols="1,5", options="header"]
|====
Expand Down Expand Up @@ -1809,12 +1807,6 @@ Only for floating point type unknowns latexmath:[{\mathbf{v}_{\mathit{unknown}}}
`=` <<tunable>>: tunable factor, latexmath:[{p \cdot \mathbf{v}_{\mathit{known},i}}] where latexmath:[{p}] is an expression that is evaluated before <<fmi3ExitInitializationMode>> is called and in <<EventMode>> due to event handling (ME) or at a communication point (CS and SE)

`=` <<discrete>>: discrete factor, latexmath:[{d \cdot \mathbf{v}_{\mathit{known},i}}] where latexmath:[{d}] is an expression that is evaluated before <<fmi3ExitInitializationMode>> is called and in <<EventMode>> due to an external or internal event or at a communication point (CS and SE).

|`clockedVariables`
|
[[clockedVariables, `clockedVariables`]]
This element is only available with the <<ClockElement>> element and is a list of value references indicating clocked variables depending on this clock.

|====

_[Example 1:_
Expand Down
13 changes: 0 additions & 13 deletions schema/fmi3ModelDescription.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<xs:attribute name="valueReference" type="xs:unsignedInt" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="Clock" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element ref="Annotations" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="valueReference" type="xs:unsignedInt" use="required"/>
<xs:attribute name="clockedVariables">
<xs:simpleType>
<xs:list itemType="xs:unsignedInt"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
5 changes: 5 additions & 0 deletions schema/fmi3Variable.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<xs:attribute name="canHandleMultipleSetPerTimeInstant" type="xs:boolean"/>
<xs:attribute name="intermediateUpdate" type="xs:boolean"/>
<xs:attribute name="previous" type="xs:unsignedInt"/>
<xs:attribute name="clocks">
<xs:simpleType>
<xs:list itemType="xs:unsignedInt"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>

<xs:group name="fmi3Variable">
Expand Down

0 comments on commit d77d194

Please sign in to comment.