-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify rules on fmi3GetInterval*/fmi3GetShift* functions with regards to periodic input clocks #2018
Comments
I think whether and when it is allowed to call fmi3GetInterval* is already precisely defined.
If no interval is provided the standard defines that the interval depends on fixed/tunable parameters. In this case the importer must be able to get the interval.
"can be set with fmi3SetIntervalDecimal OR retrieved with fmi3GetIntervalDecimal" is true for all time-based Clock types. Which call is allowed for a specific Clock, depends on the Clock type. Maybe an "either ... or" should be used here.
Yes. Adding InitializationMode in the sentence would fix that part, right?
Yes, this contradicts the definition of T_interval_i for periodic Clocks. But otherwise it could happen that the next Clock tick is already in the past. E.g., if the interval was 1s and is changed at t=0.75s to 0.5s. The the last Clock tick was at t=0 and the next at t=0.5, which is in the past.
The first call to fmi3GetInterval* at InitializationMode would return fmi3IntervalChanged. Following calls return fmi3IntervalUnchanged, until, e.g., a tunable Clock depending on parameters changes its interval. So, I think, the only issue here is the definition of the interval that is returned by fmi3GetInterval*. One solution would be to change the definition of T_interval_i for periodic Clocks to something like this: "When the interval is unchanged (no new interval is retrieved by fmi3GetInterval*), the time interval from the previous Clock tick to the current Clock tick, specified differently for the different Clock types. If a new interval is retrieved, the first new Clock interval is relative to the time of the current EventMode or ClockUpdateMode." |
Pierre: the questions is, when you are allowed to call "fmi3GetInterval". This is not clearly defined, and the result values are not clearly defined. Patrick: I could make a proposal, but I need a decision in which direction to to go |
The standard seems to suggest that these functions can be called for clocks with constant/fixed/tunable intervalVariability - at least under some circumstances - in Table 5 by listing as related API:
However for fixed/tunable it lists:
So interestingly, for fixed/tunable you can only call fmi3GetInterval/fmi3GetShift if no interval is provided in the modelDescription.xml.
While Table 6 then just generally states on T_interval_i:
which might or might not suggest that fmi3GetInterval* can always be called.
Furthermore the definition of fmi3GetInterval* then provides wording that does not suggest anyone thought of the semantics of calling them for periodic clocks:
None of the options provided seem to take constant (or even just periodic) clocks into account, and hence it is unclear what should be returned:
Taken together I think the description of this in the standard should be refined to precisely state whether and when it is allowed to call fmi3GetInterval* and what should be returned for periodic clocks.
The text was updated successfully, but these errors were encountered: