question

Stan Davis avatar image
0 Likes"
Stan Davis asked Stan Davis commented

Use Array for Wait for Event Label Matching

I am unable to determine how to set a Wait for Event's label matching to use an array. I have attached a small model demonstrating what i am trying to do.

A Wait for Event on a node's OnArrival event is employed call code that is resource-specific. The Wait for event has to match the token label's index to the resource entering the node. The model works fine for a single resource but not for a label that contains an array.

Any help would be appreciated.

FlexSim Help - Wait for Event - Array Label Matching.fsm

FlexSim 21.2.3
event triggermatch label
5 |100000

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

1 Answer

Regan Blackett avatar image
0 Likes"
Regan Blackett answered Stan Davis commented

Using an Array for the matching value isn't going to work in this case because the "Traveler" event data reported by the OnArrival event is a singular task executor that arrived to network node, which can't be compared to an array of values because they are technically incompatible data types.


Think of it like this; Mech1 one arrives to the network node, the listener waiting for the event is triggered. The Listener reports that Mech1 is the Traveler, you are trying to say "is the event's Traveler a value in the Array" but it can't because Traveler is not an Array, it's an Object. The Wait for Event Match option doesn't know it's supposed to look into the elements of an array and find a match there. You would need to get a member of your ReleasedResources array into a separate label and match Traveler with that

· 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.

Stan Davis avatar image Stan Davis commented ·

"The Wait for Event Match option doesn't know it's supposed to look into the elements of an array and find a match there"

Understood, that is why I was trying various ways of specifically pointing to an object member in the array like these below which didn't work of course...

'ReleasedResources[token.creationRank]'

'ReleasedResources[1]'

From what I now understand, even if an array contains object references, the label matching still can't compare an array to the event triggering object.

You would need to get a member of your ReleasedResources array into a separate label and match Traveler with that

Yep, I've done that elsewhere and that's the direction I'm headed again. I just thought using an array would be a more elegant solution. Thanks. - Stan


0 Likes 0 ·