예제 #1
0
        /** called by the user implementation of the environment when the action was executed */
        public void ActionExecuted(string agName, Structure actTerm, bool success, object infraData)
        {
            ExecuteAction action = (ExecuteAction)infraData;

            action.SetResult(success);
            CentralisedAgArch ag = masRunner.GetAg(agName);

            if (ag != null) // the agent may was killed
            {
                ag.ActionExecuted(action);
            }
        }
예제 #2
0
 /** called by the TS to ask the execution of an action in the environment */
 public override void Act(ExecuteAction action)
 {
     //if (logger.isLoggable(Level.FINE)) logger.fine("doing: " + action.getActionTerm());
     if (IsRunning())
     {
         if (infraEnv != null)
         {
             infraEnv.Act(GetAgName(), action);
         }
         else
         {
             action.SetResult(false);
             action.SetFailureReason(new Atom("noenv"), "no environment configured!");
             ActionExecuted(action);
         }
     }
 }