question

Louwrens Cronje avatar image
0 Likes"
Louwrens Cronje asked Logan Gold answered

Referencing a specific outobject on a dispatcher

We are trying to master a concept to input into a larger model that relates to referencing the outobject of a dispatcher that is called to a queue to perform a task.

We have attached a small model of the concept we want to achieve. The example shows a dispatcher that has only one outobject. This man must have a max capacity of '1' when moving items from the first queue, but must change his max capacity to '5' when moving items from the second queue. The logic therefore lies on the exit trigger of the 'Capacity of 5' queue and changes the max capacity back to one on the unload trigger of the man. This works without any problems.

We are struggling to do this same concept when there is more than one man connected to the dispatcher. We are struggling to reference the man specifically called to the queue to change his specific max capacity.

It would be greatly appreciated if you could indicate how to do this on the attached model.

FlexSim 16.0.1
dispatcheroutobjectchanging capacity
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Logan Gold avatar image
3 Likes"
Logan Gold answered

I feel the easiest place to reference an Operator from a Queue is in the task sequence that is sent to the Operator. You can use an option in the Queue's Transport Resource trigger called "Task Sequence Example 1" to get a good example of the default task sequence used and then tweak it to do what we want.

I am attaching your model to this email with some changes that I made.

First, I changed the Transport Resource trigger for the "Capacity of 5" Queue to use the task sequence example. The default task sequence has five tasks. 1) The Operator travels to this Queue. 2) The Operator loads the specified flowitem. 3) The Operator breaks (loads more flowitems according to the Operator's Capacity and Break To requirement). 4) The Operator travels to the flowitem's destination. 5) The Operator unloads the flowitem at the destination.

I added another task between loading the flowitem and the break task that will send a message to the Operator from the Queue. I used the sendmessage task type because it allows me to easily reference the Operator (not just the Dispatcher) that will be picked (since the task sequence initially goes to the Dispatcher) using a NULL reference as the third parameter. If you are unfamiliar with the inserttask() command, I suggest reading about it in the Help documentation, especially the Task Type Quick Reference that is linked in the inserttask description.

The last parameter of the sendmessage task is the time to send the message. We can use this to send a message at some point in the future, but since I want the message to be sent immediately (before the break task is executed) I use a 0 to indicate it should be sent immediately. If we want to send the message is 0 time, that would require putting a -1 for the last parameter. So now we have the Operator travelling to the Queue, loading the first flowitem, then a message will be received by the Operator.

Next, I added an OnMessage trigger for all the Operators connected to the Dispatcher. This is where I put the setvarnum() command that will change the Operator's Capacity/max content to 5. So the Operator can now carry 5 flowitems and will continue to collect the rest from the Queue.

So the Operator loads the first flowitem, receives the message that changes its Capacity, does the break task that allows him to load more flowitems, and he loads up to 5 total (it could be less if there are 4 or fewer flowitems to load).

I left the OnUnload trigger alone. So when the Operators unloads a flowitem, he will only be able to carry 1 flowitem at a time.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.