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 11-27-2008
Benjamin Diehl Benjamin Diehl is offline
Flexsim User
 
Join Date: Oct 2008
Posts: 1
Downloads: 10
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
Benjamin Diehl is on a distinguished road
Default 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!
Attached Files
File Type: zip Container_Terminal.zip (443.4 KB, 326 views)
  #2  
Old 11-28-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

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  
Old 03-01-2011
Jarrett Skov Jarrett Skov is offline
Flexsim User
 
Join Date: Feb 2011
Posts: 4
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
Jarrett Skov is on a distinguished road
Default

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.
Attached Files
File Type: zip Model-Dispatcher_Jarrett.zip (115.3 KB, 176 views)

Last edited by Jarrett Skov; 03-01-2011 at 03:01 PM.
  #4  
Old 03-02-2011
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

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  
Old 03-03-2011
Jarrett Skov Jarrett Skov is offline
Flexsim User
 
Join Date: Feb 2011
Posts: 4
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
Jarrett Skov is on a distinguished road
Default

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);
Thank you again for your help!


Thread Thread Starter Forum Replies Last Post
Working Logic of Dispatcher AlanZhang Q&A 6 02-09-2009 10:38 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.