@@ -23,7 +23,11 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1
23
23
- FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/)
24
24
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
25
25
"""
26
- function getState (solution:: FMUSolution , vrs:: fmi2ValueReferenceFormat ; isIndex:: Bool = false )
26
+ function getState (
27
+ solution:: FMUSolution ,
28
+ vrs:: fmi2ValueReferenceFormat ;
29
+ isIndex:: Bool = false ,
30
+ )
27
31
28
32
indices = []
29
33
@@ -40,10 +44,14 @@ function getState(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
40
44
if ! isnothing (solution. states)
41
45
for vr in vrs
42
46
found = false
43
- for i in 1 : length (solution. instance. fmu. modelDescription. stateValueReferences)
44
- if solution. instance. fmu. modelDescription. stateValueReferences[i] == vr
47
+ for i =
48
+ 1 : length (
49
+ solution. instance. fmu. modelDescription. stateValueReferences,
50
+ )
51
+ if solution. instance. fmu. modelDescription. stateValueReferences[i] ==
52
+ vr
45
53
push! (indices, i)
46
- found = true
54
+ found = true
47
55
break
48
56
end
49
57
end
@@ -61,7 +69,9 @@ function getState(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
61
69
return collect (u[indices[1 ]] for u in solution. states. u)
62
70
63
71
else # multi value
64
- return collect (collect (u[indices[i]] for u in solution. states. u) for i in 1 : length (indices))
72
+ return collect (
73
+ collect (u[indices[i]] for u in solution. states. u) for i = 1 : length (indices)
74
+ )
65
75
66
76
end
67
77
end
@@ -90,7 +100,12 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1
90
100
- FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/)
91
101
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
92
102
"""
93
- function getStateDerivative (solution:: FMUSolution , vrs:: fmi2ValueReferenceFormat ; isIndex:: Bool = false , order:: Integer = 1 )
103
+ function getStateDerivative (
104
+ solution:: FMUSolution ,
105
+ vrs:: fmi2ValueReferenceFormat ;
106
+ isIndex:: Bool = false ,
107
+ order:: Integer = 1 ,
108
+ )
94
109
indices = []
95
110
96
111
if isIndex
@@ -106,10 +121,14 @@ function getStateDerivative(solution::FMUSolution, vrs::fmi2ValueReferenceFormat
106
121
if ! isnothing (solution. states)
107
122
for vr in vrs
108
123
found = false
109
- for i in 1 : length (solution. instance. fmu. modelDescription. stateValueReferences)
110
- if solution. instance. fmu. modelDescription. stateValueReferences[i] == vr
124
+ for i =
125
+ 1 : length (
126
+ solution. instance. fmu. modelDescription. stateValueReferences,
127
+ )
128
+ if solution. instance. fmu. modelDescription. stateValueReferences[i] ==
129
+ vr
111
130
push! (indices, i)
112
- found = true
131
+ found = true
113
132
break
114
133
end
115
134
end
@@ -124,10 +143,16 @@ function getStateDerivative(solution::FMUSolution, vrs::fmi2ValueReferenceFormat
124
143
if length (indices) == length (vrs)
125
144
126
145
if length (vrs) == 1 # single value
127
- return collect (solution. states (t, Val{order})[indices[1 ]] for t in solution. states. t)
146
+ return collect (
147
+ solution. states (t, Val{order})[indices[1 ]] for t in solution. states. t
148
+ )
128
149
129
150
else # multi value
130
- return collect (collect (solution. states (t, Val{order})[indices[i]] for t in solution. states. t) for i in 1 : length (indices))
151
+ return collect (
152
+ collect (
153
+ solution. states (t, Val{order})[indices[i]] for t in solution. states. t
154
+ ) for i = 1 : length (indices)
155
+ )
131
156
end
132
157
end
133
158
@@ -156,7 +181,11 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1
156
181
- FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/)
157
182
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
158
183
"""
159
- function getValue (solution:: FMUSolution , vrs:: fmi2ValueReferenceFormat ; isIndex:: Bool = false )
184
+ function getValue (
185
+ solution:: FMUSolution ,
186
+ vrs:: fmi2ValueReferenceFormat ;
187
+ isIndex:: Bool = false ,
188
+ )
160
189
161
190
indices = []
162
191
@@ -173,10 +202,10 @@ function getValue(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
173
202
if ! isnothing (solution. values)
174
203
for vr in vrs
175
204
found = false
176
- for i in 1 : length (solution. valueReferences)
205
+ for i = 1 : length (solution. valueReferences)
177
206
if solution. valueReferences[i] == vr
178
207
push! (indices, i)
179
- found = true
208
+ found = true
180
209
break
181
210
end
182
211
end
@@ -194,7 +223,10 @@ function getValue(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
194
223
return collect (u[indices[1 ]] for u in solution. values. saveval)
195
224
196
225
else # multi value
197
- return collect (collect (u[indices[i]] for u in solution. values. saveval) for i in 1 : length (indices))
226
+ return collect (
227
+ collect (u[indices[i]] for u in solution. values. saveval) for
228
+ i = 1 : length (indices)
229
+ )
198
230
199
231
end
200
232
end
@@ -230,4 +262,4 @@ function getTime(solution::FMUSolution)
230
262
return nothing
231
263
end
232
264
end
233
- export getTime
265
+ export getTime
0 commit comments