예제 #1
0
 /**
  * Sends a message to the given agents notifying them that the environment has changed
  * (called by the user environment). If no agent is informed, the notification is sent
  * to all agents.
  */
 public void InformAgsEnvironmentChanged(params string[] agents)
 {
     if (agents.Length == 0)
     {
         foreach (CentralisedAgArch ag in masRunner.GetAgs().Values)
         {
             ag.GetReasoner().GetUserAgArch().WakeUpSense();
         }
     }
     else
     {
         foreach (string agName in agents)
         {
             CentralisedAgArch ag = masRunner.GetAg(agName);
             if (ag != null)
             {
                 ag.WakeUpSense();
             }
             else
             {
                 Debug.Log("Error sending message notification: agent " + agName + " does not exist!");
             }
         }
     }
 }
예제 #2
0
 public new void Broadcast(Message m)
 {
     foreach (string agName in masRunner.GetAgs().Keys)
     {
         if (!agName.Equals(GetAgName()))
         {
             m.SetReceiver(agName);
             SendMsg(m);
         }
     }
 }
예제 #3
0
 public IEnumerable <string> GetAgentsNames()
 {
     return(masRunner.GetAgs().Keys);
 }