Gustavo
2014-09-17 18:36:22 UTC
Hi all, I'm new in Jade world and I'm trying to do simple things at time to
learn how to use this incredible tool, but information on the Internet are
scarce.
My problem is how to execute a relative big task without locking the agent.
I started using as reference the examples from Jade:
ContractNetInitiatorAgent.java and ContractNetResponderAgent.java.
In that examples, everything works well even with my code, but, when I put a
real task in the method performAction() of the Responder, the agent gets
frozen during the execution of this task.
In my code, the Initiator searches the service in the DF, after that send a
CFP to the specific Responder, gets a propose and accept, the Responder
executes the task (in 20 seconds because this is the task) and send a
Inform. Perfect, except for the second Initiator also wants the same
service.
When the second Initiator send a CFP and the Responder is busy, there is no
communication. The Responder does not respond.
What I'm trying to do, without success, is transform the method
performAction() in a TickerBehaviour, so, the communication is not blocked
and after the action is performed, the Responder sends the final Inform with
task concluded.
In my code I got the task finished (the handleAcceptProposal calls the
Ticker action) but I can not send the final Inform, because after the
ContractNet executes the handleAcceptProposal I can't execute it again. I
tried to force the handleAcceptProposal execution inside performAction()
using forceTransitionTo and setExecutionState.
This is a good approach? What is wrong?
Or the best way is to allow the performAction() to get the Responder agent
stucked for the needed time?
There is other way(s) to not lock the agent, i.e., even the Responder is
working it can reply other messages?
Thanks in advance
--
View this message in context: http://jade.17737.x6.nabble.com/Executing-big-tasks-in-a-agent-with-ContractNet-tp5002729.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
learn how to use this incredible tool, but information on the Internet are
scarce.
My problem is how to execute a relative big task without locking the agent.
I started using as reference the examples from Jade:
ContractNetInitiatorAgent.java and ContractNetResponderAgent.java.
In that examples, everything works well even with my code, but, when I put a
real task in the method performAction() of the Responder, the agent gets
frozen during the execution of this task.
In my code, the Initiator searches the service in the DF, after that send a
CFP to the specific Responder, gets a propose and accept, the Responder
executes the task (in 20 seconds because this is the task) and send a
Inform. Perfect, except for the second Initiator also wants the same
service.
When the second Initiator send a CFP and the Responder is busy, there is no
communication. The Responder does not respond.
What I'm trying to do, without success, is transform the method
performAction() in a TickerBehaviour, so, the communication is not blocked
and after the action is performed, the Responder sends the final Inform with
task concluded.
In my code I got the task finished (the handleAcceptProposal calls the
Ticker action) but I can not send the final Inform, because after the
ContractNet executes the handleAcceptProposal I can't execute it again. I
tried to force the handleAcceptProposal execution inside performAction()
using forceTransitionTo and setExecutionState.
This is a good approach? What is wrong?
Or the best way is to allow the performAction() to get the Responder agent
stucked for the needed time?
There is other way(s) to not lock the agent, i.e., even the Responder is
working it can reply other messages?
Thanks in advance
--
View this message in context: http://jade.17737.x6.nabble.com/Executing-big-tasks-in-a-agent-with-ContractNet-tp5002729.html
Sent from the JADE - Dev mailing list archive at Nabble.com.