Ejemplo n.º 1
0
        /// <summary>
        /// Constructor. Initialize the robots. Initialize the world state.
        /// </summary>
        /// <param name="Wii"></param>
        /// <param name="Woi"></param>
        public ControlLoop(WorldInputInterface Wii, WorldOutputInterface Woi)
        {
            this.Wii = Wii;
            this.Woi = Woi;

            worldState = Wii.ws;

            List<Robot> robots = worldState.robots;
            List<PhysObject> worldObjects = worldState.physobjects;

            foreach (Robot robot in robots)
            {
                Robots.Add(robot.Id,robot);
            }

            foreach (PhysObject obj in worldObjects)
            {
                WorldObjects.Add(obj.Id, obj);
            }
            // Assume default for now. Experiment class can change after
            globalAlgorithm = new DefaultGlobalAlgorithm();
        }
Ejemplo n.º 2
0
 public void setGlobalAlgorithm(GlobalAlgorithm alg)
 {
     this.globalAlgorithm = alg;
 }