I have a problem using the human resources. In the model attached the bottom part is wheere I am having trouble with. In the last queue named kar I have an open/close input and output. It is simulating a trolley which can hold 10 products before it needs to be put away. The input closes when reached 10 and the output opens and vice versa when reached 0 again.
The problem I am having is when using human resources the HR stays at the server in front of the queue because it can't be send to the queue because it is closed. So the trigger on exit is not hit and the humanresource will not be freed. However because in the server behind the queue needs a HR to proces the products the queue will not be emptied.
So my question is:
How do I call and free the HR when the queue is full and the input closes and output opens. And vice versa?
Human resources when input is closed
Human resources when input is closed
- Attachments
-
- inbound opzet.mod
- (36.97 KiB) Downloaded 44555 times
Re: Human resources when input is closed
Hi Tomos,
A possible solution to your problem is to use the priority system of the Human Resources. Tasks can assigned a priority to ensure that they are performed before/after other tasks, even if other tasks where called at an earlier time. A priority can be assigned with the 5th parameter
of the HumanResourceTeam_CallResources function. Then in the HumanResourceTeam atom, under the strategies tab, make sure the "Sort Tasks By" field is set to "By priority descending" or "By priority ascending" depending on your preferred priority system (lower value=higher priority or higher value=higher priority).
I have attached a version of your model where I applied the priority system. With the priority system, it will prioritize the Wegzetten task after the Kar above all others. This means that the Kar queue will be emptied first before going back to the Pakken and Scannen tasks. To do this, I made 3 changes.
1. In the Strategies tab of the GUI of the HumanResourceTeam I changed the Sort Tasks By to By Priority Descending.
2. In the Wegzetten server atom after Kar, in the code of Trigger on Entry is adjusted so it Calls the human resource with a priority of 2.
3. In the Kar queue atom, I added code which closes the Output when a product enters the queue and the queue has a content less than 10. If this is not called, then the very first product which enters the queue will immediately sent to the Wegzetten server and the Wegzetten task is called because it is now prioritized over all other tasks.
Please let me know if this is not what you intended or if you have any more questions!
Kind regards,
Luuk
A possible solution to your problem is to use the priority system of the Human Resources. Tasks can assigned a priority to ensure that they are performed before/after other tasks, even if other tasks where called at an earlier time. A priority can be assigned with the 5th parameter
of the HumanResourceTeam_CallResources function. Then in the HumanResourceTeam atom, under the strategies tab, make sure the "Sort Tasks By" field is set to "By priority descending" or "By priority ascending" depending on your preferred priority system (lower value=higher priority or higher value=higher priority).
I have attached a version of your model where I applied the priority system. With the priority system, it will prioritize the Wegzetten task after the Kar above all others. This means that the Kar queue will be emptied first before going back to the Pakken and Scannen tasks. To do this, I made 3 changes.
1. In the Strategies tab of the GUI of the HumanResourceTeam I changed the Sort Tasks By to By Priority Descending.
2. In the Wegzetten server atom after Kar, in the code of Trigger on Entry is adjusted so it Calls the human resource with a priority of 2.
3. In the Kar queue atom, I added code which closes the Output when a product enters the queue and the queue has a content less than 10. If this is not called, then the very first product which enters the queue will immediately sent to the Wegzetten server and the Wegzetten task is called because it is now prioritized over all other tasks.
Please let me know if this is not what you intended or if you have any more questions!
Kind regards,
Luuk
- Attachments
-
- inbound opzet (with task priorities).mod
- (37.32 KiB) Downloaded 83063 times
Re: Human resources when input is closed
Thank you Luuk,
I figured it out using the call and free atoms but this method is a bit cleaner so I am using your method. Anyways I now added an buffer queue at the volledige pallets. This queue only sends to the pakken uit buffer server when the queue in queue14 is < 1 or 0. But the way kar has been set up it does not free the HR from scannen. How can I add a code in the trigger on entry or exit so when the content in queue14 is <1, The output will open anyways. I tried using the script below and changed some bits but I just get an error all the time.
So what I am trying to do is the buffer empties last. when the content in queue14 is empty. And the products in the queue kar will also be emptied when it can't reach the threshold of 10.
I figured it out using the call and free atoms but this method is a bit cleaner so I am using your method. Anyways I now added an buffer queue at the volledige pallets. This queue only sends to the pakken uit buffer server when the queue in queue14 is < 1 or 0. But the way kar has been set up it does not free the HR from scannen. How can I add a code in the trigger on entry or exit so when the content in queue14 is <1, The output will open anyways. I tried using the script below and changed some bits but I just get an error all the time.
Code: Select all
If(Content(c) >= 10,
Do(
CloseInput(c),
OpenOutput(c)
)
)
If(Content(AtomByName([Queue14], model)) < 1,
OpenOutput(c)
)
- Attachments
-
- inbound opzet.mod
- (44 KiB) Downloaded 53645 times
Re: Human resources when input is closed
Hi Tomos,
I hope I understand correctly but please let me know if I missed something. So what you want is that products at the "Buffer" Queue and the "Pakken uit buffer" server get processed last when there are no more products in "Queue14", no more products in "Pakken" and "Scannen" and the "Kar" has been emptied.
To do this, there would be no need to control the input/output channels of the "Buffer" Queue but just set the priority of the "Pakken uit buffer" task to -1 (lowest priority in your system). I see on the Send To attribute of the "Buffer" Atom that you placed code depending on the content of "Queue14" but this is not needed.
Now, the only thing left is to empty the "Kar" if no more products are in "Queue14". The code you attached almost works, it just misses a check to see if there are also no more products at the "Scannen" server. And the reason you get an error with your code is that both If statements should be inside a Do statement. Without Do, you can not run multiple statements in the same code. It is also possible to enter the code to check if "Queue14" is empty into the False statement of the initial If statement. I made some adjustments and the placed a working version of the code below. If you put this in the Trigger On Entry of the "Kar" queue it should work.
I attached the model with some changes I made. Please let me know if this works for you 
Kind regards,
Luuk
I hope I understand correctly but please let me know if I missed something. So what you want is that products at the "Buffer" Queue and the "Pakken uit buffer" server get processed last when there are no more products in "Queue14", no more products in "Pakken" and "Scannen" and the "Kar" has been emptied.
To do this, there would be no need to control the input/output channels of the "Buffer" Queue but just set the priority of the "Pakken uit buffer" task to -1 (lowest priority in your system). I see on the Send To attribute of the "Buffer" Atom that you placed code depending on the content of "Queue14" but this is not needed.
Now, the only thing left is to empty the "Kar" if no more products are in "Queue14". The code you attached almost works, it just misses a check to see if there are also no more products at the "Scannen" server. And the reason you get an error with your code is that both If statements should be inside a Do statement. Without Do, you can not run multiple statements in the same code. It is also possible to enter the code to check if "Queue14" is empty into the False statement of the initial If statement. I made some adjustments and the placed a working version of the code below. If you put this in the Trigger On Entry of the "Kar" queue it should work.
Code: Select all
If(
Content(c) >= 10,
{ True, Kar is full, open output }
Do(
CloseInput(c),
OpenOutput(c)
),
{ False, Kar is not full, check if Queue14 or Scannen has product, if not, open output }
If(
And(
Content(AtomByName([Queue14], Model)) = 0, { When Queue14 is empty AND }
Content(Out(1, AtomByName([Queue14], Model))) = 0 { There are no products at Scannen }
),
OpenOutput(c)
)
)

Kind regards,
Luuk
- Attachments
-
- inbound opzet.mod
- (49.2 KiB) Downloaded 29966 times
Re: Human resources when input is closed
Thank you for your help again Luuk this is perfect.