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
|
|||
|
|||
Dispatcher: PassTo-option
Hi,
I´m simulating a container-terminal with 11 cranes, 6 tracks and 1 stock for containers. For the tracks and the stock I use racks each with 44 bays which represent wagons. Each container has a determined targetbay. The racks create the TS automatically and send them to a dispatcher. The dispatcher sends the TS to one of the cranes. Each container has a label called “currentbayindex” which shows the current crane-area (1-11) of a container. I want the dispatcher to send the TS to the complying crane like this: … If “currentbayindex” of a item is 3 return 3; (crane 3 is connected to outputport 3!) If ”currentbayindex” of a item is 4 return 4; … If I use the getlabelnum(item,”currentbayindex”) option, it doesn´t work like I imagine!! How can I handle it? PS: Sorry for my bad English! |
#2
|
||||
|
||||
Benjamin,
Dispatching TSs from the dispatcher based on parameters on the sending object or flowitem is a very difficult task. Personally, I would have connected the cranes directly to the rack and then used the currentbayindex as the centerport value to pass the TS to. The greatly reduces the complexity of the problem and, unless you have some other issue that complicates the problem, is the best method to use in my opinion.
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
Benjamin Diehl (11-28-2008) |
#3
|
|||
|
|||
I have also run into this problem. I previously had my model coded as Brandon suggested, however the complexity and dynamic nature of my model makes that way of coding the task sequences too complicated and difficult to modify. I am modeling a restaurant where employees take orders, and move to several different stations in order to fill those orders. I have 4 operators currently taking orders and filling them.
As stated before, I previously had each operator connected to each station. Each operator sent a message to the proper port number for an object to create a food flowitem. That object then called him to transport the flowitem and process it. This gives each operator 15+ center ports that are becoming increasingly difficult to adjust and reference as I add more stations for them to work at. I decided to switch and use a dispatcher to receive and send the messages. Everything works great, except which operator to dispatch the task sequence to. I am using the flowitem's itemtype to maintain a reference to which operator (and thus register and queue) the object should go to. I need the dispatcher to be able to reference the itemtype of the object requesting transport. Im sure there is a way to do this, even if it is complicated? What is the best way to go about doing this? I have a bit of experience with custom commands. I am looking into the nodefunction() and parval(), etc commands but dont have a great grasp for them yet. Attached is my model. Please help me if you are able. I am planning on doing a lot of adjustments to this model to figure out the best process flow, and being able to do it all through one dispatcher instead of each new operator will make things extremely easier to manage. Last edited by Jarrett Skov; 03-01-2011 at 03:01 PM. |
#4
|
||||
|
||||
Jarrett,
Once you know the operator that you want to dispatch to then you don't have to dispatch the task sequence to the dispatcher any more. You should only need to change the createemptytasksequence() command. It probably looks like this: treenode ts = createemptytasksequence(centerobject(current, 1), 0, PREEMPT_NOT); If you have a reference to the operator stored as the port number from the dispatcher then you would change the createemptytasksequence() command to look like this: treenode ts = createemptytasksequence(outobject(centerobject(cur rent, 1), operator_port), 0, PREEMPT_NOT); If you have a reference to the operator stored as the tonum(operator) value then you would change the createemptytasksequence() command to look like this: treenode ts = createemptytasksequence(tonode(operator_value), 0, PREEMPT_NOT); If you do it this way then you can include an if statement so that if you don't know which operator to call then it uses the dispatcher but if it has already called a dispatcher then it uses the code above. Good Luck, Brandon
__________________
thats not normal. |
The Following 3 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Stefan Trabut (04-02-2011) |
#5
|
|||
|
|||
Thank you Brandon!
I did not end up doing exactly what you said because I was not able to find the code that contained the task sequence creation. I have just been using the 'request transport' box for each processor. Using what you said though, I realized I could reference the operators through the connections on the dispatcher without having to connect each operator to each process. I just created a global variable for the Dispatcher called 'Dispatcher' and in the request transport box I put this: Code:
treenode item = parnode(1); treenode current = ownerobject(c); int port = parval(2); int itemnum = getitemtype(item); return outobject(Dispatcher,itemnum); |
Thread | Thread Starter | Forum | Replies | Last Post |
Working Logic of Dispatcher | AlanZhang | Q&A | 6 | 02-09-2009 10:38 AM |