Use Array for Wait for Event Label Matching

Use Array for Wait for Event Label Matching

stan.e.davis
Advocate Advocate
48 Views
2 Replies
Message 1 of 3

Use Array for Wait for Event Label Matching

stan.e.davis
Advocate
Advocate

[ FlexSim 21.2.3 ]

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

0 Likes
Accepted solutions (1)
49 Views
2 Replies
Replies (2)
Message 2 of 3

regan_blackett
Autodesk
Autodesk
Accepted solution

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

0 Likes
Message 3 of 3

stan.e.davis
Advocate
Advocate

"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