コード例 #1
0
        public PositionSetEditSet getRandomPositionSet(int pointNum)
        {
            unchecked
            {
                int seed = (int)DateTime.Now.Ticks;
                this.pointNum = pointNum;
                LaplaceDistribution distributionX = new LaplaceDistribution(new StandardGenerator(seed++));
                distributionX.Alpha = X_Alpha;

                LaplaceDistribution distributionY = new LaplaceDistribution(new StandardGenerator(seed++));
                distributionY.Alpha = Y_Alpha;

                for (int i = 0; i < clusterPointNum; i++)
                {
                    distributionX.Mu = RandomMaker.RapidBetween(minMu, maxMu);
                    distributionY.Mu = RandomMaker.RapidBetween(minMu, maxMu);
                    RandomPositionSet randomPositionSet =
                        new RandomPositionSet((int)(pointNum / clusterPointNum), 1000, distributionX, distributionY);
                    positionSetEditSet.AddPositionSet(randomPositionSet);
                }
            }
            return(positionSetEditSet);
        }
コード例 #2
0
ファイル: Analyse.cs プロジェクト: luosz/ai-algorithmplatform
 //产生一个随机点
 KD2DPoint getRandomPoint()
 {
     //return new KD2DPoint(random.Next(mapWidth - 1), random.Next(mapHeight - 1));
     return(new KD2DPoint(RandomMaker.RapidBetween(minX, maxX), RandomMaker.RapidBetween(minY, maxY)));
 }
コード例 #3
0
 public IPosition Get()
 {
     return(new Position_Point(RandomMaker.RapidBetween(minX, maxX),
                               RandomMaker.RapidBetween(minY, maxY)));
 }
コード例 #4
0
ファイル: Analyse.cs プロジェクト: luosz/ai-algorithmplatform
 //产生一个随机点
 KD2DPoint getRandomPoint(int mapWidth, int mapHeight)
 {
     //return new KD2DPoint(random.Next(mapWidth - 1), random.Next(mapHeight - 1));
     return(new KD2DPoint(RandomMaker.RapidBetween(0.0f, mapWidth - 1.0f), RandomMaker.RapidBetween(0.0f, mapHeight - 1.0f)));
 }