question

Claire Krupp avatar image
0 Likes"
Claire Krupp asked Claire Krupp commented

Wait for Event - set State to blocked, is set back to idle

I have a situation where an AGV may not be able to unload for a short time because there is no space in the unload area.

I set up a Decide activity and then a Wait for Event, which triggers when the space opens up.

The problem is the state of the AGV is automatically set to idle, but I want it to be blocked.

I put in a custom code just before the Wait for Event, and it worked, but it gets cancelled out immediately when the token enters the Wait for Event.

I then tried putting the state change inside the Wait for Event, "On Listener Initialized" here:

1682347376882.png


Again, it works momentarily, but then is switched back to idle again.

How can I track the blocked time for this situation?

(There is a similar question from 2017, where the answer suggested adding a 0 Delay AFTER the Wait for Event, but that will not help here, and I don't want to replace it with a Delay time since the time needed to wait is unknown, and I do not want to put in a really small time and slow the model down with "churning".)

Thanks!

FlexSim 23.1.1
wait for eventstate change
1682347376882.png (69.3 KiB)
· 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.

Claire Krupp avatar image Claire Krupp commented ·

Just discovered in the Event Log, after I have set the status of the AGV to "blocked", these two events happen:

1682450073985.png

So, does that mean I need to use a Custom Task activity to change the status, so that the TS does not finish?

1682450201355.png

But how do I do that - none of the drop-down options look useful?

0 Likes 0 ·
1682450073985.png (15.0 KiB)
1682450201355.png (12.4 KiB)

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Claire Krupp commented

I would think you need the zero wait delay before the wait for event activity and set the state after that delay (or on listener initialized as you have it).

· 6
5 |100000

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

Claire Krupp avatar image Claire Krupp commented ·
That's what I tried to do. And the state does change to blocked, but as soon as it enters the Wait for Event it is overridden and set back to idle!


(And update, the "on listener initialized" does not always work - can't figure out why?)

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Claire Krupp commented ·
I think we probably need to see the model Claire. One thing you can do is step through with the event list open and see if it's tied to a particular event.
0 Likes 0 ·
Claire Krupp avatar image Claire Krupp Jason Lightfoot ♦ commented ·
OK, I can't post it publicly, but I can email it to you.

I did step through the Event List. There is no Event for the "Wait for Event" activity, but you can link it to the triggering event, which is a Move activity. I'll send the details in the email. I'll give you the times too - it's not a common occurrence, but only happens when a breakdown or changeover messes with the planned timeline.

I also put in a break point in the "on listener initialized" code, and it does not trigger every time a token enters the activity, which seems odd to me.

Shall I send it to your email, or [email protected]?

Thanks

0 Likes 0 ·
Show more comments

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.