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
Downloads

Q&A Using Flexsim and building models

  #1  
Old 08-03-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default How to choose flowitem with highest priority/lowest ID from multiple sources?

Hi,

I have multiple processors that get data from multiple queues upstream. The flowitems go to a certain processor based on one of their labels when the current time has passed a certain set time for the flowitem (which is also written in a label). I have a working pull logic that does this.

However, I get problems as I want to maintain the original flowitem order in the processing, i.e. a flowitem that is created earlier should go to the processor first. This should happen even if there is a flowitem that was created later and is going to the same processor and the first flowitem is not ready for processing yet.

What would be a good solution for this? If I would have full control over the pull logic I would loop through all available flowitems for the given processor and choose the one with the earlier creation time (or higher priority if you like). Now however, the pull requirement is fired by the Flexsim engine (if I have understood it correctly) and I have not figured out a way to get it to evaluate multiple upstream flowitems as it only returns true or false for the given processor it is called for.

One option that I thought of is to give the flowitems a predefined queue number in a label, e.g. processor1_queueNumber1 for the first flowitem that should enter processor1. Then I could check for the next not yet handled queue number in the pull requirement and not accept any other flowitem even if there are other flowitems ready for that processor. This gives an additional label of course so if there is a better solution I would like to know about it. Also, this would not work for a solution where you want to choose the flowitem with the highest priority from multiple flowitems that are ready.

Any thoughts on this? Can you think of any better/other solutions?

Thank you!

Kind regards,

Axel
  #2  
Old 08-04-2015
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Axel,

You can run into a problem, if you don't pull anything at all several times. As long as the possible item isn't ready at an object close the object's output. When the output opens the transfer mechanism is initiated again and the pull logic works.
Jörg
  #3  
Old 08-04-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Hi Jörg,

Thank you for your reply. Not sure if I had explained my problem well enough as I am not sure what part of my question you are answering. I know that the pull is initiated again when you open the output and that is what I am using currently to make the pull logic work.

So you would suggest that I would use a label or something that uniquely identifies the next object to be processed? In that case I would still be interested in knowing how this can be done when there are more than one object that are ready to be pulled, but they have different priorities and are possibly located in different upstream objects. Any clue on how this can be done?

Thanks!
Axel
  #4  
Old 08-04-2015
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

Hello Axel,

Quote:
Originally Posted by Axel Kohonen View Post
a flowitem that is created earlier should go to the processor first. This should happen even if there is a flowitem that was created later and is going to the same processor and the first flowitem is not ready for processing yet
There is a concept model in the download section Sample_TimeLabelQueueSorting which does the same thing that you have described.
The Following User Says Thank You to sagar bolisetti For This Useful Post:
Axel Kohonen (08-07-2015)
  #5  
Old 08-05-2015
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Axel,

And I don't know how much do you have read about the pull logic. There are already some threads which describe in detail how the logic works and tests the items. In a situation where all items are released you can store the reference of the best suited item to pull in a label at the pulling object. Each time the pull logic tests in the Pull Requirement a released item you compare this with the stored referenced item for equality. If the comparison match you pull that item with return 1.
As you see above when the pull logic starts there has to be set two conditions.
You have to know the item to pull and this item has to be ready to be released.
If your item isn't ready for releasing you have to delay the pull logic until the item gets ready. You close the input or the outputs of the involved objects.
You can put all the logic to find the right item into the pull requirement without a stored reference to an item. But when all released items are tested and none match your testing logic you have to initiate the pull logic again yourself.

Jörg
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
sagar bolisetti (08-05-2015)
  #6  
Old 08-07-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Thank you Sagar and Jörg,

@Sagar:
Thank you for the link to the model file. I should get the pull with priority working nicely with the help of this one and the pick list options in the pull.

@Jörg:
I have read about the pull logic in the user manual and all the threads about it that I was able to find on the forum. Then I tried multiple different solutions, but at that stage it still did not work reliably. It seems that sometimes the problem is that you cannot find the right questions/sample model in large amount of threads about specific problems. Another problem is that a lot of the sample models cannot anymore be downloaded as there obviously was a server crash sometime late last year (see https://www.flexsim.com/community/fo...2939#post13580) and older models were lost.

@Flexsim developers
Would be great when the new answers.flexsim.com pages become live if the links to threads and sample models about a certain topic (e.g. pull logic) would be given on the same page as the user manual entry about the topic. This way they could be easily found.

Thank you again!
Axel
The Following 3 Users Say Thank You to Axel Kohonen For This Useful Post:
Jörg Vogel (08-07-2015)

Tags
multiple input, priority, pull strategy, send to port


Thread Thread Starter Forum Replies Last Post
Send message from a sink to different sources Ismail Benabicha Flexsim Student Forum 1 05-11-2015 09:59 AM
Using sources and distributions Hassan Elhajj Q&A 3 02-19-2015 02:41 AM
Option to choose different state in Timetable David Chan User Development 2 06-01-2014 08:32 AM
combining same temtypes from two sources Radhakrishnan R Q&A 5 08-03-2012 11:59 AM
Lowest performance item? Tom David Q&A 2 04-29-2010 02:06 PM


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.