Craig DIckson avatar image
Craig DIckson asked Matthew Gillespie edited

How to use A * when I create task executer using process flow?

I defined a class of task executers using the flow item bin, and set it to use A*. But when I use process flow to create those task executers, the resulting TEs aren't in the A*. Is there a simple way to make sure they use A*? (If not, is there a complicated way? LOL)

Also I am using 20.1.1 but that's not in the pulldown below yet.

FlexSim 20.1.0
process flowflexsim 20.1.0a star
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie edited

Here are the ways to do it currently:

1. In a custom code block after you create the person, use this code to attach the person to the A* Navigator

contextdragconnection(Model.find("AStarNavigator"), token.Person, 'A');

2. In the Create Object activity choose Create In and create the person in the A* Navigator, this will attach the person to the navigator. You might then need to move the person to where you actually want them.

3. Use the Create Person activity instead of Create Object. The Create Person activity automatically does this if there's an A* Navigator in the object. Note, however, that by adding this People activity it will also add a bunch of People groups, lists, and down behaviors to the model as well.

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

Craig DIckson avatar image Craig DIckson commented ·

@Matthew Gillespie First, to be clear I am not creating people; I am creating AMRs (Automated Mobile Mobots, the generic name for what Kiva does -- basically a smarter AGV). Can I use "create person" for this? (The main reason I am using process flow to create them is because there are a couple hundred of them in the facility; I was trying to save the tedium of creating them individually in 3d, and also to allow fewer in a particular run without worrying about parking out of the way.)

When I create the AMR in the A*, the model stops with the token at that activity, and when I reset it it seems like the Create activity at the top is disabled, and I need to either replace it with a new Create activity, or restart the model.

If I use the custom code block, it almost works, except that 1.) the graphics of my AMR are gone -- all that moves is the blue collision circle and 2.) when I reset the model the created AMR is still shown in the A* list, so after a few runs I end with qith quite a number of extra non-existent AMRs. So I suppose I need a trigger to clear all traveler members from A* on reset? What would that code look like?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Craig DIckson commented ·

OK, I see. It looks like the Add a New Task Executer Flowitem option in the FlowItem Bin doesn't quite set up the new TE flowitem correctly. We'll get that fixed. If you want to fix it in your model you can run this script:

treenode bin = Model.find("Tools/FlowItemBin");
for (int i = 1; i <= bin.subnodes.length; i++) {
    treenode obj = bin.subnodes[i].first;
    if (isclasstype(obj, "TaskExecuter")) {
        assertattribute(obj, "itemtype", 0);

        treenode resetPosition = getvarnode(obj, "resetposition");
        set(resetPosition, 0);

After doing that methods 1 and 2 should work fine.

0 Likes 0 ·
Craig DIckson avatar image Craig DIckson Matthew Gillespie ♦♦ commented ·

@Matthew Gillespie So do I run this in a custom code activity each time I run the model? Or just once in the Script console?

And whichever I do, does that mean that the new AMR task executers do go away when I reset, so I can create the correct number of them each time the model runs, which is what I was hoping to do?



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.