question

Daniel avatar image
0 Likes"
Daniel asked Jason Lightfoot commented

How to Build Decision Points and Connect Objects for AGV Paths Using FlexScript?

Hello,

I am currently working on building AGV paths in FlexSim and can successfully draw the paths. However, I am looking for guidance on how to create decision points along the paths using FlexScript. Additionally, I would like to understand how to connect these decision points to various objects such as Sources, Sinks, Queues, and Processors.

Could anyone provide an example or share some best practices for this type of implementation? Any advice or relevant resources would be greatly appreciated!

Thank you in advance for your help!

FlexSim 24.2.0
agvflexscriptagv paths
· 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.

I'm not sure which method you're using to construct your model but consider defining it all in Tables and inserting into Objects() using Table.query().
0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

Adding CPs to paths is just a matter of creating them and then setting them to the correct location. They should snap to the path automatically. (See also the Kiva demo model https://answers.flexsim.com/articles/132744/kiva-system-demo-model.html)

The Vec3 class will be useful to find locations along a straight path (start with a vector going from the start to the end point, then normalize and scale it based on the desired spacing between the CPs). For curved paths, their location is the center of the circle the path describes. So by using that, the radius, start and sweep angle you can find positions along the path.

To make connection, you can use "function_s(cp, "addConnection", rank, object)". "Rank" is the position the connection type appears in the connections list in the AGV Network Properties. So a "Location" connection would be rank 1.

capture1.png


capture1.png (16.1 KiB)
5 |100000

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