From: Jomi H. <jom...@gm...> - 2017-04-26 15:24:43
|
Hi Bourdil, you are right in your analysis of the problem. I am working on a solution for that — that is in the java level, not .asl. I hope to come back soon with a solution. Best, Jomi ps.: Indeed, the block() is executed after the answer from the environment is received… So I do not know why the agent is being waked … I guess previous versions of JADE worked differently (the versions we used to develop the JADE infrastructure)…. Again, I need to investigate it further. > On 26 de abr de 2017, at 11:10, BOURDIL Pierre-Alain <Pie...@sc...> wrote: > > I investigated the problem I had, relative to a 100% cpu consumption when executing the example from http://www.emse.fr/~boissier/enseignement/maop11/doc/jason-api/mini-tutorial/jason-jade/index.html > To sum up, the seller agent (ie:JadeAgArch) never sleep. > > I understood that : > > 1) In class JasonTSReasonner (method action), a jade Cyclic behavior, and in async mode (the default), the agent try to sleep 1sec after each reasonning cycle . This is implemented through a call to jade.core.Behaviour.block. > 2) Nevertheless, it asks for percept to environnementAID at each perceive phase of a reasoning cycle : QUERY_REF acl message with content getPercept > 3) EnvironmentAID answer (an INFORM ACL message), thus waking up the agent . The documentation of Jade’s block clearly state that block is in fact non blocking. (http://jade.tilab.com/doc/api/jade/core/behaviours/Behaviour.html#block()) > 4) Hence, the agent never sleep and consume 100% CPU. > > > Am I right ? > If yes, Is there a way to change that behavior ? If not , how can I avoid these , maybe by allowing to put some wait from the asl sources ? > > > + > > Pierre-Alain BOURDIL > Ingénieur R&D > > 05.61.00.79.79 > pie...@sc... > > <image002.png> > > SYSTÈMES NUMÉRIQUES > > 417 L’Occitane > CS 77679 > 31676 LABEGE Cedex > > scalian.com > > <image004.png> > <image006.png> > <image008.png> > <image010.png> > > > > > > <image012.png> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ > Jason-users mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-users -- Jomi Fred Hubner Federal University of Santa Catarina Department of Automation and Systems Engineering PO Box 476, Florianópolis, SC 88040-900 Brazil http://jomi.das.ufsc.br |