question

shanice.c avatar image
0 Likes"
shanice.c asked Felix Möhlmann commented

How to control agv only travel on the specific path?

Hello, I have agvs only travel in specific zone using conditional rules. I need taskexecuter3 to travel on blue path, which nextworkpoint should be Controlpoint13, but in the right properties pane, we could see Connections have their order. Is there a way to look ahead next next point, then agv would know it should choose Controlpoint13? Or how to control agv only travel on the path it is allowed to allocate?

1653449426563.png

testConditionalrule_autosave.fsm

FlexSim 22.1.1
conditional rule
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

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

I would solve this by adding an extra expression field to the NextWorkPoint list. This field checks whether the task executer ('puller.agv') is allowed to travel on the path the respective control point is located on.

1653460093943.png1653460452930.png

You can then use this in the query of the 'Get Next Work Point' pull from list activity to only choose a control the task executer can actually travel to. (This only checks the path the control point is on, so if only a previous or subsequent path on the route is not allowed this will not work).

The above code can also be adjusted to implement a priority. In the case above, if a task executer the choice between a path with a condition it is allowed to travel on and a path without a condition, the chosen path again depends on the order on the list.

By returning a higher value if there is a true condition and ordering by that value in the query, it will always choose the path with the rule over the one everyone can travel on.

1653460499297.png

1653460519134.png(The model you uploaded seems to be a different one than the one in your screenshot, so I build my won small example model.)

NextWork_PathRule_fm.fsm


· 4
5 |100000

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

shanice.c avatar image shanice.c commented ·

Hello @Felix Möhlmann Thank you for the response. May I ask what "condition" variable will return? Because I couldn't understand line 14th if-statement.

1653529820789.png1653529902969.png

I saw value of "pathAllowed" field is "Puller Required", this means it returns true in if-statement.

圖片1.png

0 Likes 0 ·
1653529820789.png (69.8 KiB)
1653529902969.png (109.6 KiB)
圖片1.png (602.9 KiB)
Felix Möhlmann avatar image Felix Möhlmann shanice.c commented ·
If the 'condition' node is empty, like in your screenshot, the path does not use a rule and the if-statement will return false -> the code skips line 16 and the 'return 1' in line 20 is used.

If it does contain a rule, the return value becomes the result of that condition's evaluation (line 16).

The list shows 'Puller Required', because the expression field uses the puller variable. So the field will only be evaluated when something is trying to pull a value from the list and all you see when viewing the list is that placeholder text.

0 Likes 0 ·
shanice.c avatar image shanice.c Felix Möhlmann commented ·

Hello @Felix Möhlmann, I tested printing out line16 of the code.

May I ask if not use conditional rule, the

return (condition.evaluate(puller.agv));

would be 0, just like AGV PathProperties in last column, the paths not using rule have value "none";

The paths using rule have rule name, such as"Rule 2", and

return (condition.evaluate(puller.agv));

would be 1?

1653619908489.png

And the reason you multiply the return function by 2 is to let conditional rule has higher priority than path without a condition (if need this logic)?

0 Likes 0 ·
1653619908489.png (82.3 KiB)
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.