private AgentMessageHandler findHandler(int actorID) { AgentMessageHandler handler = null; handlers.TryGetValue(actorID, out handler); return(handler); }
public void synchronizeBelief(Belief belief, int sourceID) { AgentMessageHandler handler = findHandler(sourceID); if (handler != null) { handler.synchronizeBelief(belief); } }
public void synchronizeAllBeliefsFor(int actorID) { AgentMessageHandler handler = findHandler(actorID); if (handler != null) { handler.synchronizeAllBeliefs(); } }
public void handleMessage(Message message) { BSPMessage bspMessage = parse(message); AgentMessageHandler handler = null; if (handlers.TryGetValue(bspMessage.getSourceID(), out handler)) { handler.handleMessage(bspMessage); } }
public string getConnectionString(int actorID) { AgentMessageHandler handler = findHandler(actorID); if (handler != null) { IPEndPoint address = handler.getConnection().getRemoteAddress(); if (address != null) { return(address.ToString()); } } return("Not Connected"); }
public PostMessageHandler(BeliefRepository repo, AgentMessageHandler protocol, Serializer serializer) { this.repo = repo; this.protocol = protocol; this.serializer = serializer; }
public ConnectMessageHandler(BeliefRepository repo, AgentMessageHandler protocol) { this.repo = repo; this.protocol = protocol; }
public void addActor(int actorID, BeliefRepository repo) { INetworkConnection connection = new AgentConnection(this, actorID); handlers[actorID] = new AgentMessageHandler(actorID, repo, connection, serializer); }
public SyncMessageHandler(BeliefRepository repo, AgentMessageHandler protocol) { this.repo = repo; this.protocol = protocol; remoteState = new RepositoryState(-1); }