ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Sending a group of parts via Shortest Queue
I am having troubles sending parts down stream to the queue with the shortest content. What i need to have the program do is look at the item type to see if it changed. If it changes then find out which queue has the smallest content. Then route all parts to that queue until the itemtype changes to reevaluate. What is wrong with my coding?
Much appreciated. Thanks, treenode item = parnode(1); treenode current = ownerobject(c); /**Shortest Queue*/ /** \nSend to the port corresponding to the shortest queue downstream.*/ treenode tempobject; int curmincontent = 1000000000; // this sets the integer to the largest possible value that an integer can hold. double curminindex = 0; double curinitemtype = getitemtype(current); double lastitemtype = 10000; if(curinitemtype != lastitemtype) { lastitemtype = getitemtype(current); for(int index = 1; index <= nrop(current); index++) { tempobject = outobject(current, index); if(objectexists(tempobject) && content(tempobject) < curmincontent) { curmincontent = content(tempobject); curminindex = index; } } } return curminindex ; |
Thread | Thread Starter | Forum | Replies | Last Post |
Createcopy of a group | David Chan | Q&A | 1 | 11-01-2012 07:02 AM |
Group Capacity | Jason Lightfoot | User Development | 7 | 03-24-2011 07:21 PM |
adding a node to a group | Frank Janssen | Q&A | 2 | 02-08-2010 09:34 AM |
New LinkedIn Group | Bill Nordgren | Product Announcements | 0 | 01-21-2010 11:50 AM |
shortest path algorithm | Vinay Mehendiratta | Q&A | 5 | 01-25-2008 11:42 AM |