question

Emily K avatar image
0 Likes"
Emily K asked Jason Lightfoot edited

How to save control point into list

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!

FlexSim 21.2.4
listcontrolpoints
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

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

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Jason Lightfoot edited

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.


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

kl avatar image kl commented ·

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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ kl commented ·
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.

1 Like 1 ·
kl avatar image kl Jason Lightfoot ♦♦ commented ·

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 0 ·
1688406217399.png (8.2 KiB)
random-test2.fsm (196.3 KiB)
Show more comments