ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Tips and Tricks
Downloads

Tips and Tricks Share helpful modeling ideas

  #1  
Old 03-26-2013
Joseph Mueller Joseph Mueller is offline
Flexsim User
 
Join Date: Feb 2013
Posts: 7
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Joseph Mueller is on a distinguished road
Default 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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.