Ejemplo n.º 1
0
        public StateModel BestRandomState(ShapeType shapeType, int apha, int shapeProbeCount)
        {
            double     bestScore = 0;
            StateModel bestState = new StateModel();

            for (int i = 0; i < shapeProbeCount; i++)
            {
                var state = RandomState(shapeType, apha);
                var score = state.Score();
                if (i == 0 || score < bestScore)
                {
                    bestScore = score;
                    bestState = state;
                }
            }
            return(bestState);
        }
Ejemplo n.º 2
0
        public StateModel BestState(ShapeType shapeType, int alpha, int shapeProbeCount, int shapeAge, int m)
        {
            double     bestScore = 0;
            StateModel bestState = new StateModel();

            for (int i = 0; i < m; i++)
            {
                StateModel state = BestRandomState(shapeType, alpha, shapeProbeCount);
                //StateModel state = RandomState(t, a);
                state.HillClimb(shapeAge);
                var score = state.Score();
                if (i == 0 || score < bestScore)
                {
                    bestScore = score;
                    bestState = state;
                }
            }
            return(bestState);
        }