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 > Q&A
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2010
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 134
juan alberto is on a distinguished road
Default output order of objects

Hi all,


I have four objects in the queue, and I would like to choose the Output order of the queue. I create a label on objects called proirity.

I read the label of the four items and want to send out the object with the label "priority" = 1, then priority = 2 and so on. . .


Thanks.
Attached Files
File Type: zip output order.zip (37.0 KB, 159 views)
Reply With Quote
  #2  
Old 06-21-2010
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 315
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

I would connect the Queue and the Conveyor 4 times and set the "Send to Port" in the Queue to:

/**Custom Code*/
treenode item = parnode(1);
treenode current = ownerobject(c);


int value = getlabelnum(item,"priority");

switch(value){

case 1: return 1;
case 2: return 2;
case 3: return 3;
case 4: return 4;
default: return 0;
}

Now you only have to close and open the ports in the way you want. Probably in the triggers of the Queue and the Conveyor.
I tried it with setting "Round Robin" in the "Pull From Port" of the Conveyor, but this doesn´t work the way you wanted I expect.

Sorry that I can´t load up a modell.
__________________
Hemmi
Reply With Quote
The Following User Says Thank You to Sebastian Hemmann For This Useful Post:
juan alberto (06-21-2010)
  #3  
Old 06-21-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Attached is a solution. I use a label on the queue to record the priority and time of entry as a table, then sort that table and find the rank of the new entry. Then set the rank of the item to match. When the item leaves, we assume it's rank 1 in the queue and remove the first row from the table. Because of that it's assuming no pull rules on the other objects are pulling other ranks. If you need that too, post here and I'll adjust this solution to make that work.

So Queue3 has modified entry, exit and sendto triggers. I've also changed the sendTo so that it no longer holds items (since you need to release them somehow later), and instead closed the output on reset and open it when we've a good queue accumulated (so that you can see the ordering).
Attached Files
File Type: zip output order2.zip (42.8 KB, 168 views)
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
juan alberto (06-21-2010)
  #4  
Old 06-21-2010
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 196
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

You need all the 4 items in the queue. So set the queue to 'Perform Batching' and the Target Batch size to 4.
In the OnEntry Trigger you can sort the order of the items:

if(content(current)==4)
{ // the last item is entering
for(int x=1;x<=4;x++)
{ // set the rank of all items to the given priority
setrank(rank(current,x),getlabelnum(rank(current,x ),"priority"));
}
}

(int the attached file the items are sorted by their itemtype)
Attached Files
File Type: zip Modell.zip (31.8 KB, 160 views)
__________________
kind regards Nico.
Reply With Quote
The Following User Says Thank You to Nico Zahn For This Useful Post:
juan alberto (06-21-2010)
  #5  
Old 06-21-2010
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 134
juan alberto is on a distinguished road
Default

Thanks all.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the maximum output of the model in 10 hours? john mic Q&A 1 05-14-2010 11:57 AM
Problem with Send to Output Port Joe Allen Q&A 3 05-14-2009 02:38 PM
change the objects in self modeled objects Manuel Kraenzle Q&A 7 10-27-2008 02:29 PM
Output high volume data Liu Bin Q&A 8 06-16-2008 09:18 AM
Problem with Processor Output avinash Q&A 2 03-26-2008 09:19 AM


All times are GMT -6. The time now is 03:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.