[Pogamut-list] Waiting for SELF Message in Agent.java run()

ghanold pogamut-forum at artemis.ms.mff.cuni.cz
Wed Dec 30 14:34:42 CET 2009


Waiting for SELF Message in Agent.java run() 

Author: ghanold

I am implementing MonitoringPlayer to capture player paramenters.  When the agent reaches the run() method, it sits in the while (isrunning()) loop waiting for the hasself() to be set.  I get the Waiting on SELF message in the logs to determine this.

I do not see where or when the SELF message would be generated.  Can anyone direct me to how to initiate or force a SELF message.  I have included below the Agent.java while loop that generates the message.

      while (isRunning()) { // iteration of the agent logic
           System.out.println("isRunning().");
           tempTime = System.currentTimeMillis();
           // 0th - check the logicIsPaused flag
           if (this.logicIsPaused) {
           // we should pause the logic - change the flag
               System.out.println("Switching communication state to PAUSED.");
               this.platformLog.finest("Switching communication state to PAUSED.");
               this.body.getCommunicationStateFlag().setFlag(CommunicationState.PAUSED);
               this.logicPauseLatch.await();
               // logic resumed - change the flag
               System.out.println("Switching communication state to BOT_RUNNING.");
               this.platformLog.finest("Switching communication state to BOT_RUNNING.");
               this.body.getCommunicationStateFlag().setFlag(CommunicationState.BOT_RUNNING);
           }
           // check whether logic is ready to run - agent has self and memory is not restarted - otherwise it will perform
           // restart of memory and let the logic anyway
           if (this.logicReady()) {
               body.pauseMessageProcessing();
               System.out.println("doLogic Call.");
               doLogic();
               body.resumeMessageProcessing();
           } else {
           System.out.println("Waiting for the SELF message.");
           platformLog.info("Waiting for the SELF message.");
           }





More information about the Pogamut-list mailing list