示例#1
0
        public override double ObservationProbability(Action a, Observation o)
        {
            MazeObservation oTruth = m_mdMaze.GetWallConfiguration(this);
            MazeObservation mo     = (MazeObservation)o;

            return(mo.ProbabilitySame(oTruth));
        }
示例#2
0
        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            else if (GetType() != obj.GetType())
            {
                return(false);
            }
            else
            {
                MazeObservation o = (MazeObservation)obj;

                return(this.RightWall == o.RightWall && this.BackWall == o.BackWall && this.FrontWall == o.FrontWall && this.LeftWall == o.LeftWall);
            }
        }
示例#3
0
        public double ProbabilitySame(MazeObservation oTruth)
        {
            double dProb = 1.0;

            if (FrontWall == oTruth.FrontWall)
            {
                dProb *= WALL_DETECTION_ACCURACY;
            }
            else
            {
                dProb *= (1 - WALL_DETECTION_ACCURACY);
            }
            if (RightWall == oTruth.RightWall)
            {
                dProb *= WALL_DETECTION_ACCURACY;
            }
            else
            {
                dProb *= (1 - WALL_DETECTION_ACCURACY);
            }
            if (LeftWall == oTruth.LeftWall)
            {
                dProb *= WALL_DETECTION_ACCURACY;
            }
            else
            {
                dProb *= (1 - WALL_DETECTION_ACCURACY);
            }
            if (BackWall == oTruth.BackWall)
            {
                dProb *= WALL_DETECTION_ACCURACY;
            }
            else
            {
                dProb *= (1 - WALL_DETECTION_ACCURACY);
            }
            return(dProb);
        }