I wonder if anyone has found a nice way to achieve the following use case.
I have an EntityConveyor which has, say, a travel time of 10 s. In order to control other parts of the model I'd like to have an indication of when an Entity is in the last 2 seconds of the conveyor. I want to use this to control/define an ExpressionThreshold: it's "open" if there is no item on the conveyor in the last 2 seconds of travel time; "closed" otherwise.
I can write little expressions to capture the entry time of an entity when it enters the conveyor and to calculate +8 and +10 seconds to define the window of interest and save these as attributes for each entity on the conveyor. I can also use the EntityList of the conveyor to find the first entity and hence the next +8 and +10 s times to use. These can be put into an ExpressionThreshold to see if SimTime is between these two limits and so set open or close. But, as the user manual makes clear, these states only get updated when events happen. So, it is not a robust approach.
Is there another approach that would work that I have missed, or could there be a need for a type of "delay object" that is used to schedule an event/update in the future based on a current event?
My current try at a workaround is to generate loads of events but this is bad for performance and intellectually quite "wrong"!
Best wishes,
John