How to save control point into list

How to save control point into list

e_yiing98
Not applicable
198 Views
6 Replies
Message 1 of 7

How to save control point into list

e_yiing98
Not applicable

[ FlexSim 21.2.4 ]

Hi there,
I want to let AGV choose a random path when it enters an intersection, instead of selecting the shortest route. I want to trigger this behavior when AGV enters the cp (ControlPoint_I1) before the intersection.
I duplicate the AGVWork list and create a RandomCP to save the control points (CP1, CP2, CP3), therefore I could pull random CP from the list using query, ORDER BY RAND()

But how could I save those cps into list?
I have created 2 models using different PF, I have no idea which is better to achieve my goal.
sample_using AGV PF.fsmsample_using general PF.fsm

Hope to get some suggestion, thanks!

0 Likes
Accepted solutions (1)
199 Views
6 Replies
Replies (6)
Message 2 of 7

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

Couple things I noticed in your model:

- The On Arrival event only fires when the AGV actually stops at the respective control point. Use the On Pre Arrival event when the AGV might be just passing through.

- The travel activity would only start after the AGV has completed its current task (-sequence). With other network types, you would have to create a preempting task sequence. With the AGV network you can use the Control -> AGV -> Redirect option in the custom code activity.

To get the control points onto the list you can add them to the initial content.

1683206358474.png

I would then suggest to check the Leave Entries On List option in the Pull From List activity, so they are never actually removed from the list. (Saves you having to push them back)

1683206335287.png

sample-using-general-pf-fm.fsm

If not needed, I would not use the AGV Process Flow in this case. On one hand it keeps its own list of control points based on the NextWork connections. So you would only need to add the ORDER BY clause to the relevant activity.

1683206508346.png

But, since this section of the Process Flow is not used when the AGV is 'unloading mode', you would have to add the logic from the General Process Flow anyway but furthermore make sure that it only activates when the AGV is unloading, as to not interfere with the rest of the AGV flow.

Message 3 of 7

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Emily K, was Felix Möhlmann'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
Message 4 of 7

karen8
Not applicable

Hi Felix!!! From the file you provide "sample-using-general-pf-fm.fsm", you used the method ORDER BY RAND() to let the AGV choose the path by random. However, everytime I reset the model and run again it will have the same result. I wonder if there is a way that can let the AGV have a different path selection every time I run the model again~

THANK YOU!


0 Likes
Message 5 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
This is normal in simulation models where you want to be able to repeat /debug /reduce variance.

You can change the replication number (which determines the random number stream initialization) from the experimenter or uncheck repeat streams - I'd recommend the former for the above reasons.

Message 6 of 7

karen8
Not applicable

Got it thks!

Now I tried to apply the random select path method which Felix used in the file sample-using-general-pf-fm.fsm in my file random_test2.fsm. My goal is to random select path (randomly select ControlPoint3, ControlPoint4, or ControlPoint8) after reaching ControlPoint2.

I tried to put the random select thing (the picture below) into the Advanced AGV process flow, but my model doesn't seem to randomly select path now.

1688406217399.pngMy file : random_test2.fsm

Not sure if I did anything wrong in the model, hope to get some suggestion ~ thanks!

0 Likes
Message 7 of 7

jason_lightfootVL7B4
Autodesk
Autodesk

Your model should have no exceptions printed to the output console. You have hundreds but make no mention of these - fix these first.

You have inappropriate instances attached to the process flow - they should be agvs (you have just one - taskexecuter1)

1688645075655.png

You're also missing the label assignment for 'agv' in the cp prearrival detection.

Your CP arrival detection code should probably not be in this process flow since it would not scale to more than one taskexecuter. I suggest having a seperate object process flow for the redirection to a random CP.

0 Likes