question

Alessio Merlo avatar image
1 Like"
Alessio Merlo asked Matthew Gillespie answered

Multiple event in the same wait for event activity: bug or missing feature?

Hi,

today I tried to model a monitor on the object state change, but I encountered some troubles.

I used the activity Wait for Event, I sampled the object and I chose the event "state change" twice. Why twice? Because I want to listen the transition from any state to blocked or breakdown state. But when I ran the model an exception occured. I isolated the issue in a simple model (waitforevent-1.fsm).

I don't know if it is a bug or a missing feature. I tried to reproduce a double event listener in another model (waitforevent-2.fsm), but the issue occurs again.

Then I believe that it is a missing feature. Will be possible to implement this feature in the next release?

FlexSim 17.1.2
bugwait for eventfeature request
waitforevent-1.fsm (18.8 KiB)
waitforevent-2.fsm (20.5 KiB)
· 2
5 |100000

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

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Is there a reason you don't want to use two different Wait for Event activities for this?

0 Likes 0 ·
Alessio Merlo avatar image Alessio Merlo Matthew Gillespie ♦♦ commented ·

Yes, because with only one activity I want to simulate an "or" condition: the first event catched releases the token. With two different activities I would manage the "abort" of the activity which doesn't trigger the correct event. Is the idea clear?

Your proposal is valid workaround, even if I must use at least 3 activities (with only one I would obtain the same result). I found another workaround using decision condition at the end of activity which implements a switch case on the state saved into a label. My solution isn't so "elegant" because a self loop to the same activity I need, but use only one activity and no "abort" condition.

As for you, is a bug or a missing feature? I believe that the feature is implemented correctly, but there is an issue in the cycle which calls back the listener. I suppose this situation: the trigger has two listeners related the same activity, when the first one is called back releases the token of the activity which destroys the second one while exiting. Then the cycle to call back the monitor want to do two iterations, the first one is performed correctly, the second one fails because the call back function doesn't exist more. I don't know how the call back system is implemented, then it is only a hypothesis.

Any futher details are appreciated.

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

We've added this to the list of bugs to fix for the next 17.0 bug fix release. Thanks for pointing it out!

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.