Esempio n. 1
0
        public ClientApplication(XmlPacketTransmitter<IilPerceptCollection, IilAction> transmitter, IAgentLogic logic)
        {
            this.logic = logic;
            this.transmitter = transmitter;

            logic.EvaluationCompleted += logic_EvaluationCompleted;
            logic.JobCreated += logic_JobCreated;
            logic.PerceptsLoaded += logic_PerceptsLoaded;
            logic.JobLoaded += logic_JobLoaded;
        }
Esempio n. 2
0
        protected override Func<KeyValuePair<string, AgentController>> AquireAgentControllerContructor()
        {
            TcpClient client = listener.AcceptTcpClient();
            string agentName = agentid + "";
            agentid++;
            Func<KeyValuePair<string, AgentController>> func = () =>
            {

                Agent agent = new Agent(agentName);
                XmlReader reader = XmlReader.Create(client.GetStream(),new XmlReaderSettings(){ConformanceLevel=ConformanceLevel.Fragment});
                XmlWriter writer = XmlWriter.Create(client.GetStream(),new XmlWriterSettings(){ConformanceLevel = System.Xml.ConformanceLevel.Fragment});
                XmlPacketTransmitter<IilAction, IilPerceptCollection> transmitter = new XmlPacketTransmitter<IilAction, IilPerceptCollection>(reader, writer);
                AgentConnection connection = new AgentConnection(agent,transmitter);
                this.ActionManager.Queue(new AddStandbyAgentAction(agent));
                return new KeyValuePair<string,AgentController>(agentName, connection);
            };
            return func;
        }
Esempio n. 3
0
 public AgentConnection(Agent agent, XmlPacketTransmitter<IilAction, IilPerceptCollection> transmitter)
     : base(agent)
 {
     this.transmitter = transmitter;
     evtman.AddEventQueue(agent.ConstructEventQueue());
 }