Discussion:
[jade-develop] Killing Agent in container
mr.nauman9
2014-01-14 21:13:50 UTC
Permalink
Hi every one;
I read different posts where users discussed about killing the container. I
want agent to kill itself after completion of its task. I tried
this.dodelete() but it didn't work for me.


thank you



--
View this message in context: http://jade.17737.x6.nabble.com/Killing-Agent-in-container-tp5002404.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
Dmontier Aragão
2014-01-14 21:28:41 UTC
Permalink
It would be better if you describe details of the problem, but you could
try:
myAgent.doDelete()

-----------------------------------------------
Dmontier Pinheiro Arag?o Junior
Degree Computer Sciences (UFC)
Ms Transports Engineering (UFC)
Studying PhD Industrial Engineering (UFSC)
Email / Gtalk: dmontier at gmail.com
Skype: dmontieraragao


2014/1/14 mr.nauman9 <mr.nauman9 at gmail.com>
Post by mr.nauman9
Hi every one;
I read different posts where users discussed about killing the container. I
want agent to kill itself after completion of its task. I tried
this.dodelete() but it didn't work for me.
thank you
--
http://jade.17737.x6.nabble.com/Killing-Agent-in-container-tp5002404.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140114/3b6452c1/attachment.html>
mr.nauman9
2014-01-14 21:35:53 UTC
Permalink
actually agents executes after dodelete() method. I want agent to stop
executing and terminate in all aspects.



--
View this message in context: http://jade.17737.x6.nabble.com/Killing-Agent-in-container-tp5002404p5002406.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
Dmontier Aragão
2014-01-14 23:19:13 UTC
Permalink
You're right. Have you could take a look in the section 3.2.1.2 (Stopping
agent execution) of the programmers guide?
An agent really ends when the method takeDown() is executed, maybe this
help you.


-----------------------------------------------
Dmontier Pinheiro Arag?o Junior
Degree Computer Sciences (UFC)
Ms Transports Engineering (UFC)
Studying PhD Industrial Engineering (UFSC)
Email / Gtalk: dmontier at gmail.com
Skype: dmontieraragao


2014/1/14 mr.nauman9 <mr.nauman9 at gmail.com>
Post by mr.nauman9
actually agents executes after dodelete() method. I want agent to stop
executing and terminate in all aspects.
--
http://jade.17737.x6.nabble.com/Killing-Agent-in-container-tp5002404p5002406.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140114/6d4447e0/attachment.html>
Caire Giovanni
2014-01-15 20:43:29 UTC
Permalink
Hi,

Some additional clarifications:
Agent.doDelete() triggers the agent termination. Note however that doDelete() just sets an internal flag so that, as soon as the currently running behavior completes, the agent termination takes place.
So for instance the code below prints "I am still running" even if this printout occurs after calling doDelete()
...
public void setup() {
addBehaviour(new OneShotBehaviour(this) {
public void action() {
myAgent.doDelete();
System.out.println("I am still running");
}
});
}

When the agent termination takes place, the last operation executed by the agent internal Thread is the invocation of the agent takeDown() method. So takeDown() is automatically invoked by the underlying JADE runtime and should not be called explicitly.

A complete explanation of the agent life cycle can be found in the JADE Programming Tutorial for Beginners (sections 3 and 4 in particular).

Bye,

Giovanni

Da: jade-develop-bounces at avalon.tilab.com [mailto:jade-develop-bounces at avalon.tilab.com] Per conto di Dmontier Arag?o
Inviato: mercoled? 15 gennaio 2014 00:19
A: mr.nauman9
Cc: jade-develop at avalon.tilab.com
Oggetto: Re: [jade-develop] Killing Agent in container

You're right. Have you could take a look in the section 3.2.1.2 (Stopping agent execution) of the programmers guide?
An agent really ends when the method takeDown() is executed, maybe this help you.

-----------------------------------------------
Dmontier Pinheiro Arag?o Junior
Degree Computer Sciences (UFC)
Ms Transports Engineering (UFC)
Studying PhD Industrial Engineering (UFSC)
Email / Gtalk: dmontier at gmail.com<mailto:dmontier at gmail.com>
Skype: dmontieraragao

2014/1/14 mr.nauman9 <mr.nauman9 at gmail.com<mailto:mr.nauman9 at gmail.com>>
actually agents executes after dodelete() method. I want agent to stop
executing and terminate in all aspects.



--
View this message in context: http://jade.17737.x6.nabble.com/Killing-Agent-in-container-tp5002404p5002406.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
_______________________________________________
jade-develop mailing list
jade-develop at avalon.tilab.com<mailto:jade-develop at avalon.tilab.com>
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140115/04c1802b/attachment.html>
Loading...