コード例 #1
0
        public override void populateSensors()
        {
            base.populateSensors();

            //Adds the pieSlice sensor to the robot
            pieSliceSensor = new PieSliceSensorArray(this);
        }
コード例 #2
0
        /*
         * Schrum: Adding the if statement seems to fix this method so that it works
         * with both Dangerous Foraging and Two Rooms experiments. Need to keep an eye on
         * it though.
         */
        // Schrum: Added so pie-slice sensors would be initialized even with specialized number of rangefinders
        public override void populateSensors(int numRangeFinders)
        {
            //Console.WriteLine("numRangeFinders:" + numRangeFinders);
            base.populateSensors(numRangeFinders);
            //Console.WriteLine("before: " + pieSliceSensor);

            //This code only seems to be needed for Dangerous Foraging, which
            // has no range finders.
            if (numRangeFinders == 0)
            {
                pieSliceSensor = new PieSliceSensorArray(this);
            }
            //Console.WriteLine("after: " + pieSliceSensor);
        }