Esempio n. 1
0
 /// <summary>
 /// deregisters agent
 /// </summary>
 public void DeregisterAgent(Agent a)
 {
     acInternalRequest = ACRequests.SynchronizeAgentList;
     while (acInternalRequest == ACRequests.SynchronizeAgentList) Thread.Sleep(20);
     agentRegister.Remove(a);
     acInternalRequest = ACRequests.SynchronizeAgentList;
     while (acInternalRequest == ACRequests.SynchronizeAgentList) Thread.Sleep(20);
 }
Esempio n. 2
0
 public BotAgentMessage(Agent sender, Agent receiver, BotAgentMessages msgType, string content)
     : base(0, sender, receiver, sender, content)
 {
     this.msgType = msgType;
 }
Esempio n. 3
0
 /// <summary>
 /// creates response for this message
 /// </summary>
 /// <param name="replyTo">agent to send response to. set to null to ignore (answers will go to sender of this message)</param>
 /// <param name="content">response content</param>
 public AgentMessage CreateResponse(Agent replyTo, string content)
 {
     return new AgentMessage(threadID, receiver, replyTo ?? sender, receiver, content);
 }
Esempio n. 4
0
 /// <summary>
 /// used for sending messages to other agents
 /// </summary>
 public void SendMessage(Agent a, AgentMessage msg)
 {
     msg.sender = this;
     a.ReceiveMessage(msg);
 }
Esempio n. 5
0
 /// <param name="threadID">set to 0 to ignore</param>
 /// <param name="sender">sender of a message</param>
 /// <param name="receiver">receiver of a message</param>
 /// <param name="replyTo">agent to send response to. set to null to ignore (answers will go to sender of this message)</param>
 /// <param name="content">message content</param>
 public AgentMessage(int threadID, Agent sender, Agent receiver, Agent replyTo, string content)
 {
     this.threadID = threadID;
     this.sender = sender;
     this.receiver = receiver;
     this.replyTo = replyTo;
     this.content = content;
 }