question

craig-dickson avatar image
0 Likes"
craig-dickson asked Jeanette F commented

realtime() as a trigger?

Is it possible to use realtime() as an event for e.g. an event driven source? We want to poll a database for new information to reconfigure the model and make new predictions.

If necessary we could use model time and run speed as a proxy, but doing it directly would be better if it doesn't make the run speed unreasonably slow.

FlexSim 24.0.1
realtimeevent driven
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @craig-dickson, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

I think this would normally be done as part of the model reset sequence via the earliest Parameter onSet trigger (which would allow other parameters to be set and the model reconfigured before it is fully reset).

You can schedule a realtime delay in your code but if you have other things running in the model they will continue to run, and if you stop the model then this realtime delay is also suspended.

await Delay.realTime(1);  //causes your code to suspend for one second.



5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.