Jump to content

Vector/Matrix of Timers


johnhagood
 Share

Recommended Posts

I want to be able to schedule events for the future without having to define a separate timer for each possible time this will happen. Ideally i'd like to be able to index into a vector of timers to start one, so it can be dependent on a state variable.

One use of these would be recurring tasks, for instance, while a patient is in post-surgery, they will be administered medicine every r hours. This is dependent on them exiting surgery (it doesn't begin at a specific time), so a rate table doesn't really work, and that would run into a similar problem of having to define different rate tables for each patient type and recurring tasks (potentially hundreds).

 

Any ideas?

Edited by johnhagood
Link to comment
Share on other sites

I believe you can't create of vector of elements. Although, you can create a element reference state vector, which might be helpful.

Your best bet would probably be modelling your process logic to trigger events through the Fire step, instead of using a timer.

Or maybe adding a timer inside a object model, so every instance of that object has its own timer.

Link to comment
Share on other sites

 Share

×
×
  • Create New...