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
|
|||
|
|||
Conveyor decision - allow entry by predicate
Hi,
I have a simple model with two conveyors merging into a third one. I have a predicate function that returns a boolean value to indicate whether an incoming item is allowed to merge onto the outgoing conveyor. In the attached example, this is implemented as a user function which simply checks the item type of the incoming item and allows them through in a round-robin fashion (first item type 1, then item type 2, then item type 1 again, etc). I would like to allow one item in, then re-evaluate the predicate function for any waiting items at the incoming decision points as soon as the outgoing decision point is crossed. I tried using Restricted Areas as described in the manual, but I cannot get it to work properly. Thanks in advance for any suggestions! |
#2
|
|||
|
|||
Hi,
1)First of all, you are not declaring the item in your user command. You wrote this: /**/return getitemtype(item) == Type;/**/ And should be this: treenode item = parnode(1);//Getting the node of item passed as argument /**/return getitemtype(item) == Type;/**/ 2)Set the area owner in the decision point that releases (DP3) as "conveyor" instead of "current". By just doing this, you will notice that the conveyor that receives a itemtype==Type will be closed and the items will begin to accumulate in the queue. I tried some thing and noticed that, depending on what exactly you want to do in your model, the logic you want to use can be quite problematic to implement. Flexsim has a basic tradeoff summed as: You can use a lot of Flexsim objects to create a model with little code, or a lot of code to create a model with little Flexsim objetcs. This means that your logic can be easily implemented if you can use a queue between your conveyors. Hope it helped for now, JG |
The Following User Says Thank You to Joao Marques For This Useful Post: | ||
Mischa Spelt (06-22-2015) |
#3
|
|||
|
|||
Something I tried
I don't know what exactly you want, but this model attached work as asked: when Type=1, only item type 1 will move, DP3 has an OnArrival trigger that releases on this condition: >>getitemtype(item)==Type
and changes Type: >>if(getitemtype(item)==1) Type=2; >>else Type=1; Best Regards,JG |
Thread | Thread Starter | Forum | Replies | Last Post |
problem to fix errors in decision point | mefhsmflexsimbr | Q&A | 0 | 05-22-2014 08:33 PM |
Decision point in Basic conveyor | Manoj Kumar | Q&A | 3 | 02-29-2012 10:31 AM |
Using Queue in a decision tool | George Serhan | Q&A | 8 | 01-06-2012 10:31 AM |
Entry trigger | mallik | Q&A | 4 | 01-25-2008 07:18 AM |
manual entry | danieldiep | Q&A | 5 | 11-26-2007 06:11 AM |