fmi-standard icon indicating copy to clipboard operation
fmi-standard copied to clipboard

Handling of time-based Clocks with interval=0

Open PTaeuberDS opened this issue 1 year ago • 5 comments

In section 2.3.5. State: Event Mode in the description of the fmi3SetClock function the following restriction is made for time-based clocks:

"Only time-based Clocks must not be active for more than one call of fmi3UpdateDiscreteStates per Event Mode."

This restriction contradicts the possibility for aperiodic time-based clocks to return an interval=0, which is possible according to the interval definition for, e.g., changing clocks: image

The restriction should only be made for periodic clocks: "Only ~time-based Clocks~ periodic Clocks must not be active for more ..."

PTaeuberDS avatar Dec 19 '23 10:12 PTaeuberDS

FMI Design Webmeeting:

Klaus: is it possible to call fmi3getInterval in event mode? Patrick: yes Klaus: This question sound familiar ... Implicitely we would make a time-based clock a triggered clock. This was perhaps the intention. Patrick: But allowing an interval=0 is a contradiction.

Does someone remember why we have it as it is defined currently?

chrbertsch avatar Dec 19 '23 15:12 chrbertsch

Any new insights here?

PTaeuberDS avatar Apr 16 '24 16:04 PTaeuberDS

"Only time-based-clock must not be active for more than one call of [fmi3UpdateDiscreteStates] per [Event Mode]" is very hard to understand, it would be good to reformulate this phrase to be easier to read.
Yes, I agree that a changing clock (which is apriodic) can have a zero Time Interval. So it contradicts.

masoud-najafi avatar Apr 16 '24 20:04 masoud-najafi

How would you propose to fix that? I think it makes sense to allow interval=0 for aperiodic and triggered clocks and to disallow it for periodic clocks.

PTaeuberDS avatar Apr 17 '24 05:04 PTaeuberDS

I agree with this change..

masoud-najafi avatar Apr 17 '24 07:04 masoud-najafi