Anylogic change sequence in service block
up vote
1
down vote
favorite
Dear AnyLogic community,
I have created a model to evaluate different methods of autonomous control.
I have agents with different due dates and want the agent with the soonest due date to be served first. At the moment the incoming agents are not sorted in any way but served according to the FIFO rule.
Is there a possibility to modify the sequence of the agents in a service block without adding a seperate queue?
Many thanks for your time & help!
java simulation anylogic
New contributor
add a comment |
up vote
1
down vote
favorite
Dear AnyLogic community,
I have created a model to evaluate different methods of autonomous control.
I have agents with different due dates and want the agent with the soonest due date to be served first. At the moment the incoming agents are not sorted in any way but served according to the FIFO rule.
Is there a possibility to modify the sequence of the agents in a service block without adding a seperate queue?
Many thanks for your time & help!
java simulation anylogic
New contributor
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Dear AnyLogic community,
I have created a model to evaluate different methods of autonomous control.
I have agents with different due dates and want the agent with the soonest due date to be served first. At the moment the incoming agents are not sorted in any way but served according to the FIFO rule.
Is there a possibility to modify the sequence of the agents in a service block without adding a seperate queue?
Many thanks for your time & help!
java simulation anylogic
New contributor
Dear AnyLogic community,
I have created a model to evaluate different methods of autonomous control.
I have agents with different due dates and want the agent with the soonest due date to be served first. At the moment the incoming agents are not sorted in any way but served according to the FIFO rule.
Is there a possibility to modify the sequence of the agents in a service block without adding a seperate queue?
Many thanks for your time & help!
java simulation anylogic
java simulation anylogic
New contributor
New contributor
New contributor
asked Nov 9 at 17:16
Marie
82
82
New contributor
New contributor
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday
add a comment |
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
Benjamin's solution is good, but if you insist in not wanting to use a queue before the service block, and that you need to use a service block no matter what then you can set up priorities like this:
Your agent's priority will be higher when the due date is closer.
Since you have already set up the priorities inside your agent, then there is nothing else to do but this (unless you want preemption).
But the priority can just be this if you want to set it up (priority being a parameter defined in your agent):
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
add a comment |
up vote
0
down vote
You can map due dates to priorities, as Felipe suggested.
Alternatively, a more direct approach would be to use the queue priorisation mode "Agent comparison". Lets say your agents have a parameter "myDueDate" of type Date
.
Then you can simply arrange agents with the most urgent due date as below, essentially saying "prefer the incoming agent1 to an existing agent2 if it is more urgent". The incoming agent will jump ahead of each of the queue members until it finds one that is even more urgent.
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Benjamin's solution is good, but if you insist in not wanting to use a queue before the service block, and that you need to use a service block no matter what then you can set up priorities like this:
Your agent's priority will be higher when the due date is closer.
Since you have already set up the priorities inside your agent, then there is nothing else to do but this (unless you want preemption).
But the priority can just be this if you want to set it up (priority being a parameter defined in your agent):
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
add a comment |
up vote
0
down vote
accepted
Benjamin's solution is good, but if you insist in not wanting to use a queue before the service block, and that you need to use a service block no matter what then you can set up priorities like this:
Your agent's priority will be higher when the due date is closer.
Since you have already set up the priorities inside your agent, then there is nothing else to do but this (unless you want preemption).
But the priority can just be this if you want to set it up (priority being a parameter defined in your agent):
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Benjamin's solution is good, but if you insist in not wanting to use a queue before the service block, and that you need to use a service block no matter what then you can set up priorities like this:
Your agent's priority will be higher when the due date is closer.
Since you have already set up the priorities inside your agent, then there is nothing else to do but this (unless you want preemption).
But the priority can just be this if you want to set it up (priority being a parameter defined in your agent):
Benjamin's solution is good, but if you insist in not wanting to use a queue before the service block, and that you need to use a service block no matter what then you can set up priorities like this:
Your agent's priority will be higher when the due date is closer.
Since you have already set up the priorities inside your agent, then there is nothing else to do but this (unless you want preemption).
But the priority can just be this if you want to set it up (priority being a parameter defined in your agent):
edited 2 days ago
answered 2 days ago
Felipe
1,5672721
1,5672721
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
add a comment |
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
Thanks a lot. Your solution does really help me!
– Marie
2 days ago
add a comment |
up vote
0
down vote
You can map due dates to priorities, as Felipe suggested.
Alternatively, a more direct approach would be to use the queue priorisation mode "Agent comparison". Lets say your agents have a parameter "myDueDate" of type Date
.
Then you can simply arrange agents with the most urgent due date as below, essentially saying "prefer the incoming agent1 to an existing agent2 if it is more urgent". The incoming agent will jump ahead of each of the queue members until it finds one that is even more urgent.
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
add a comment |
up vote
0
down vote
You can map due dates to priorities, as Felipe suggested.
Alternatively, a more direct approach would be to use the queue priorisation mode "Agent comparison". Lets say your agents have a parameter "myDueDate" of type Date
.
Then you can simply arrange agents with the most urgent due date as below, essentially saying "prefer the incoming agent1 to an existing agent2 if it is more urgent". The incoming agent will jump ahead of each of the queue members until it finds one that is even more urgent.
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
You can map due dates to priorities, as Felipe suggested.
Alternatively, a more direct approach would be to use the queue priorisation mode "Agent comparison". Lets say your agents have a parameter "myDueDate" of type Date
.
Then you can simply arrange agents with the most urgent due date as below, essentially saying "prefer the incoming agent1 to an existing agent2 if it is more urgent". The incoming agent will jump ahead of each of the queue members until it finds one that is even more urgent.
You can map due dates to priorities, as Felipe suggested.
Alternatively, a more direct approach would be to use the queue priorisation mode "Agent comparison". Lets say your agents have a parameter "myDueDate" of type Date
.
Then you can simply arrange agents with the most urgent due date as below, essentially saying "prefer the incoming agent1 to an existing agent2 if it is more urgent". The incoming agent will jump ahead of each of the queue members until it finds one that is even more urgent.
answered Nov 9 at 20:10
Benjamin
8651512
8651512
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
add a comment |
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
I know that this would be the best way, but actually I wanted to solve the problem without adding a seperate queue. Is there a possibility to include this comparison in the service block so I can leave out the extra queue?
– Marie
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
No. But the service block is really just a seize-delay-release combination to save some space. However, some of the detailed properties cannot be found in the service object. So if you need one (like queue ordering) you must untangle your service object. All it costs you is a little screen space... Go for it 🙂
– Benjamin
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
The problem was that the queue length of the service block was already used in several decision processes within my model, so Felipe's solution helps me best. Next time I will untangle the service object and use seperate elements.
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
Nevertheless, thanks a lot for your quick answers and your time and help!
– Marie
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
no worries, I get your point. I just thought that the mapping from a date to an int-priority might be non-trivial. In general, though, you should get comfortable with so-called "refactoring" as you build larger models: it is inevitable to having to shed some objects, replace it with others and "reattach" code that uses old objects to new ones. Otherwise, you will get stuck soon with messy make-dos :-)
– Benjamin
2 days ago
add a comment |
Marie is a new contributor. Be nice, and check out our Code of Conduct.
Marie is a new contributor. Be nice, and check out our Code of Conduct.
Marie is a new contributor. Be nice, and check out our Code of Conduct.
Marie is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230472%2fanylogic-change-sequence-in-service-block%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
use priorities... The sooner the due date, the higher the priority. Agents will be served according to their priorities. Have you tried that out?
– Felipe
Nov 9 at 18:04
I assigned priorities now, but I don't know how to call them up within the service block?
– Marie
2 days ago
In a service block, you can only use priorities to call up resources by their priority. You cannot sort the embedded queue within the service object. You need to add another queue object ahead of the service, only there can you make it sort by priority (or agent comparison as suggested below). Also, make sure to set the service-object queue size to 1 (0 is impossible) so there is no queing happening within service.
– Benjamin
2 days ago
Does that mean that setting the task priority according to the agent's priority like suggested by Felipe does not ensure that the order with the highest priority gets served first?
– Marie
2 days ago
I think it might not, actually. It isn't clear from the help on the Service block. Suggest you just create your own manual test to see how it really works :-) You could be right that the priority for service blocks actually sorts the queue. I never use it as the queue-seize-delay-release blocks allow me greater flexibility :-) sorry for the confusion
– Benjamin
yesterday