question

Sudharsan R avatar image
0 Likes"
Sudharsan R asked Ben Wilson commented

Shortest Queue is Missing in V2021?

HI,

I am using the latest version V 2021.20.0.1. In this version, i am working on Process flow model.

I couldn't see the "shortest queue" option in the decide block.

FlexSim 21.0.1
processflowflexsim 21.0.1
1610858977682.png (262.0 KiB)
· 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.

1 Answer

Marcello Rosadini avatar image
0 Likes"
Marcello Rosadini answered Sudharsan R commented

Hi Sudharsan,

that seems to be the case. I am not sure about the reason of it being removed, buy you could open the code editor for the Decide activity:

and just paste this code (copied from the shortest queue option on a previous version of FlexSim)

  1. Object current = param(1);
  2. treenode activity = param(2);
  3. Token token = param(3);
  4. treenode processFlow = ownerobject(activity);
  5. /**Shortest Queue*/
  6. /**Send to the connector corresponding to the activity with the shortest queue.*/
  7. int curmincontent =  1000000000; // this sets the integer to the largest possible value that an integer can hold.
  8. int connector = 1;
  9.  
  10. for (int index = 1; index <= nrop(activity); index++) {
  11.     treenode tempactivity = outobject(activity, index);
  12.     int activitycontent = getstat(tempactivity, "Content", STAT_CURRENT, current);
  13.     if (activitycontent < curmincontent) {
  14.         curmincontent = activitycontent;
  15.         connector = index;
  16.     }
  17. }
  18.  
  19. return connector ;

1610859871177.png (9.6 KiB)
· 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.