question

Emily K avatar image
0 Likes"
Emily K asked Andrew O commented

AGV Path Planning

In my previous post, there are all unidirectional paths.

To cope with bidirectional paths, I add a process flow "Path planning" and new control points connection, named "Alternative".

I want to check the AGV "travelPath" when it receive a task, if there are paths that coincide with other AGVs, then redirect the AGV to an alternative route by searching the current cp's Alternative, if there is no available path, delay. This method is reference to this post.

Due to my immature coding skills, there is some exception, any advice would be much appreciated!

Besides, how should I define the value of otherAGV in <Assign Labels> activity?

1124.fsm

FlexSim 21.2.4
agvagv process flowagvpathpath planning
1124.fsm (179.5 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.

Andrew O avatar image Andrew O commented ·

Hi @Emily K, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

You probably need nested loops or some other method to compare each of the two agvs paths to see if they overlap with one another along these lines:

treenode agvNavNode = current.find(">variables/navigator/1+");
treenode ownpaths = agvNavNode.subnodes["travelPath"];                            // The node that contains the path sections that are part of the current travel task
                                    // The path we are checking - initialized to the first path of the travel task


// Get path for other AGV
agvNavNode = otherAGV.as(Object).find(">variables/navigator/1+");
treenode otherpaths = agvNavNode.subnodes["travelPath"];


//Check AGV travel path
for (treenode pathSelf=ownpaths.first;objectexists(pathSelf); pathSelf=pathSelf.next)
    {
        for (treenode pathOther=otherpaths.first;objectexists(pathOther);pathOther=pathOther.next) {
        // Compare paths
        if(pathSelf.value == pathOther.value)
        {
.....etc

But at the moment I fail to see where you will get the otherAGV reference - in your model you set the label to zero.

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

Emily K avatar image Emily K commented ·

I found that in event OnCollision, it has option to define other AGV as other object, while current are all task executers in the model. The value of the label <otherAGV> is supposed to be other AGVs in my model, so that I could compare each of the two agvs.

1669452906804.png

Isn't the for loop in script is a nested loop?

I was thinking of getting the time window of each path so that I could know which path segment of two agvs will coincide precisely, is it possible?

Or do you have any feasible way based on your understanding of Flexsim?

0 Likes 0 ·
1669452906804.png (11.6 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Emily K commented ·
You could store a map of non-overlapping time slots by path by calculating all the acceleration/deceleration events over the network and then referring to that... this would result in no interaction blocking behaviours for any of the AGVs - which may be suboptimal. It would be a lot of work and I'm not sure it would give you what you want or need.
0 Likes 0 ·
Emily K avatar image Emily K Jason Lightfoot ♦ commented ·

Thanks for your kind response :)
Could you give me more hints to achieve this? Should I start with process flow using custom code or module SDK?

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.