Pull only elements from list that are in label array

Pull only elements from list that are in label array

olavnarjord
Not applicable
58 Views
3 Replies
Message 1 of 4

Pull only elements from list that are in label array

olavnarjord
Not applicable

[ FlexSim 22.1.4 ]

I am having problems filtering out the correct elements from a list. I have a pickloop that has totes on it with specific destinations. I am routing these based on the distance along conveyor, and I have a script that works for the distance. The trouble I'm having is that I only want to have the destinations that are stored in the tote to be "pullable" if that makes sense.

On each tote I have a label array like this:

1681071796927.png

And a list with the following entries:

1681071838619.pngHere is an illustration of the loop:

1681072081962.png

The logic is that I only want the decision points in "dests" to be applicable for pulling. So in this specific situation, "/DP3" is the closest one, but it's not on the list. Thus, it should choose /DP4 because that's in "dests", and is the closest one.

I have tried to make this work for a few hours and I'd appreciate any help.

pull_based_on_approved_destinations.fsm


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

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

Change the puller to be the token so that you can reference the tote in a WHERE clause, and the still access the dp in the time_to_dp expression.

WHERE value IN puller.tote.dests
Message 3 of 4

olavnarjord
Not applicable

Thank you!

I got it to work with this query:

WHERE value IN puller.tote.dests ORDER BY time_to_dp ASC

And by slightly changing the conveyor time script to this:

Variant value = param(1);
Variant puller = param(2);
treenode entry = param(3);
double pushTime = param(4);

Object dp = puller.dp;

double convtime = Conveyor.estimateConveyTime(dp, 0, value, 0, 1, CONV_ESTIMATE_STANDARD_SPEEDS);


return /**/convtime/**direct*/;

I guess I'll have to use the puller keyword when working with lists.

0 Likes
Message 4 of 4

jason_lightfootVL7B4
Autodesk
Autodesk
Yes sorry for the token reference - a late night mistake.
0 Likes