コード例 #1
0
        private void InitializeSimulation()
        {
            room = new Room("Room.txt");
            ProximitySensor prSens      = new ProximitySensor(room);
            DrivingUnit     drivingUnit = new DrivingUnit(room);

            robot = new Robot(prSens, drivingUnit, room);
            Thread t = new Thread(new ThreadStart(runSimulation));

            t.IsBackground = true;
            t.Start();
        }
コード例 #2
0
ファイル: Robot.cs プロジェクト: zalavari/Porszivo
        public Robot(ProximitySensor proximitySensor, DrivingUnit drivingUnit, Room room_)
        {
            ProximitySensor = proximitySensor;
            DrivingUnit = drivingUnit;

            room = new FieldType[room_.MaxX, room_.MaxY];
            for (int i = 0; i < room_.MaxX; ++i) for (int j = 0; j < room_.MaxY; ++j) {room[i,j] = FieldType.UNKNOWN;}
            roomMaxX = room_.MaxX;
            roomMaxY = room_.MaxY;
            
            radius = 1;
            positionX = room_.RobotX;
            positionY = room_.RobotY;

            algorithm1 = new RandomPathChooserAlgorithm(this);
            algorithm2 = new DepthFirstSearchPathChooserAlgorithm(this);
        }