From: BOURDIL Pierre-A. <Pie...@sc...> - 2017-04-26 14:10:16
|
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...<mailto:pie...@sc...> [cid:image002.png@01D2BEA7.906C53C0] SYSTÈMES NUMÉRIQUES 417 L'Occitane CS 77679 31676 LABEGE Cedex scalian.com<http://www.scalian.com/> [cid:image004.png@01D2BEA7.906C53C0]<https://www.facebook.com/ScalianGroup/> [cid:image006.png@01D2BEA7.906C53C0]<http://www.viadeo.com/fr/company/scalian> [cid:image008.png@01D2BEA7.906C53C0]<https://fr.linkedin.com/company/eurogiciel> [cid:image010.png@01D2BEA7.906C53C0]<https://twitter.com/scaliangroup> [cid:image012.png@01D2BEA7.906C53C0] |