Exemple #1
0
        private static IList <BoardAnalysisWeightAdjustment> GetAllAdjustments(BoardAnalysisWeightAdjustment lastAdjustment)
        {
            List <BoardAnalysisWeightAdjustment> adjustments = new List <BoardAnalysisWeightAdjustment>();

            for (int i = 1; i <= 63; i++)
            {
                BoardAnalysisWeightAdjustment adj = lastAdjustment;

                adj.articulationPointAdj += (i & 1) > 0 ? 0.2 : -0.2;
                adj.hivailableSpaceAdj   += (i & 2) > 0 ? 0.2 : -0.2;
                adj.possibleMovesAdj     += (i & 4) > 0 ? 0.2 : -0.2;
                adj.queenBreathingAdj    += (i & 8) > 0 ? 0.6 : -0.6;
                adj.unplayedPiecesAdj    += (i & 16) > 0 ? 0.2 : -0.2;
                adj.ownedBeetleAdj       += (i & 32) > 0 ? 0.4 : -0.4;

                adjustments.Add(adj);
            }
            return(adjustments);
        }
Exemple #2
0
        private static BoardAnalysisWeights AdjustWeights(BoardAnalysisWeights oldWeights, BoardAnalysisWeightAdjustment weightsAdjustment)
        {
            BoardAnalysisWeights newWeights = oldWeights;

            newWeights.articulationPointDiffWeight   += weightsAdjustment.articulationPointAdj;
            newWeights.hivailableSpaceDiffWeight     += weightsAdjustment.hivailableSpaceAdj;
            newWeights.possibleMovesDiffWeight       += weightsAdjustment.possibleMovesAdj;
            newWeights.queenBreathingSpaceDiffWeight += weightsAdjustment.queenBreathingAdj;
            newWeights.unplayedPiecesDiffWeight      += weightsAdjustment.unplayedPiecesAdj;
            newWeights.ownedBeetleStacksWeight       += weightsAdjustment.ownedBeetleAdj;
            return(newWeights);
        }