question

YANG W2 avatar image
0 Likes"
YANG W2 asked Ben Wilson commented

How to let multiple AGV load maximum capacity?

The scenario happens when I have multiple AGVs, my AGV has a capacity of 4, my input comes every 4 item with 69.82s, thus it assign 4 AGV to load each item, but what I want is one AGV to load 4 items.

AGV_SIMULATION_OS PACKING.fsm

FlexSim 18.1.2
flexsim 18.1.2agv loadmaximum capacity
· 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.

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

The better option is to correctly employ the AGV Process Flow - which is done by not using the dispatcher for transport but instead using the option Push Item to List (no task sequence) which will put it on a list called AGVWork.

This is as per the Description in the AGV Process flow template which you should read in full.


Your model attached is updated to use the process flow template.

random-available-test_agv_jl.fsm


5 |100000

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

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

That's because the PassTo of the dispatcher is not looking for already allocated work.

Use this code for the PassTo which has a section to look for a matching destination of any AGV:

  1. treenode tasksequence = param(1);
  2. Object current = ownerobject(c);
  3. /**Pass to the object closest to the destination if available*/
  4. /**If the object is on a network, then network travel is calculated; otherwise centroid-to-centroid distance is used.
  5. /**Consider available objects only if none are found, then the tasksequence will be queued up using the
  6. Queue Strategy, and will be sent to the first available.*/
  7. double curmin = GLOBAL_UNREACHABLE;
  8. int minindex = 0;
  9. treenode destination = NULL;
  10. for (int taskrank = 1; taskrank <= gettotalnroftasks(tasksequence) && destination == NULL; taskrank++) {  // this finds the first task in the tasksequence that is a travel task.
  11.     if (gettasktype(tasksequence,taskrank) == TASKTYPE_TRAVEL)
  12.         destination = gettaskinvolved(tasksequence,taskrank,1);
  13. }
  14. if (destination==NULL) // first available if there is no travel task
  15.     return 0;
  16.  
  17. //Check if there's a matching destination.
  18. for (int index = 1; index <= current.outObjects.length; index++) {
  19.     treenode curobj = current.outObjects[index];
  20.     if (curobj && isclasstype(curobj, CLASSTYPE_TASKEXECUTER)) {
  21.         if (inputopen(curobj)){
  22.             treenode  ts=gettasksequence(curobj,0);    //TaskSequence  ts=gettasksequence(curobj,0);  
  23.             if (objectexists(ts)) {
  24.                 int curtask=getcurtask(ts);  
  25.                 for (int taskrank = curtask; taskrank <= gettotalnroftasks(tasksequence) ; taskrank++) {  // this finds the first task in the tasksequence that is a travel task.
  26.                     if (gettasktype(tasksequence,taskrank) == TASKTYPE_TRAVEL) {
  27.                         Object taskdest = gettaskinvolved(tasksequence,taskrank,1);
  28.                         if (taskdest==destination)
  29.                             return index;
  30.                     }
  31.                 }
  32.             }
  33.         }
  34.     }
  35. }
  36.  
  37. for (int index = 1; index <= current.outObjects.length; index++) {
  38.     treenode curobj = current.outObjects[index];
  39.     if (curobj && isclasstype(curobj, CLASSTYPE_TASKEXECUTER)) {
  40.         if (ipopen(curobj, opipno(current, index)) && inputopen(curobj)){
  41.             double curdist = distancetotravel(curobj, destination);
  42.             if (curdist != GLOBAL_UNREACHABLE && (curmin == GLOBAL_UNREACHABLE || curmin > curdist)) {
  43.                 curmin = curdist;
  44.                 minindex = index;
  45.             }
  46.         }
  47.     }
  48. }
  49.  
  50. return minindex;
· 3
5 |100000

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