示例#1
0
        public int ComputeProbabilisticDestinationFloor(int currentFloor, int floorBound)
        {
            double[] distrib = new double[floorBound + 1];
            ProbabilityHelper.SetUniformDistribution(distrib);
            int expected = currentFloor + RelativeFloor;

            if (expected <= floorBound && expected >= 0)
            {
                distrib[expected] = SuccessProb;
                ProbabilityHelper.NormalizePdf(distrib, 0);
            }
            ProbabilityHelper.PdfToCdf(distrib);
            return(ProbabilityHelper.Sample(distrib));
        }
示例#2
0
        public NavigationSystem(World world)
        {
            Point upper = world.UpperBound;

            WorldShape = new int[] { upper.X + 1, upper.Y + 1, upper.Z + 1, 4 };
            _strides   = MathHelper.GetIndexStrides(WorldShape);

            int length = WorldShape[0] * WorldShape[1] * WorldShape[2] * WorldShape[3];

            _belief       = new double[length];
            _viewMap      = new int[length];
            _occupancyMap = new int[length / 4];

            _tempPdf        = new double[length];
            _gaussianKernel = ProbabilityHelper.NormalDistribution(0, _translationStd);

            //Инициализация убеждения равномерным распределением
            ProbabilityHelper.SetUniformDistribution(_belief);
            FillMaps(world);
        }