AIMA.Core.Search.Adversarial.AlphaBeta.copy C# (CSharp) Method

copy() public method

public copy ( ) : AlphaBeta
return AlphaBeta
        public AlphaBeta copy()
        {
            return new AlphaBeta(alpha, beta);
        }
    }

Usage Example

コード例 #1
0
        protected int maxValue(GameState state, AlphaBeta ab)
        {
            int v = int.MIN_VALUE;

            if (terminalTest(state))
            {
                return(computeUtility(state));
            }
            else
            {
                List <GameState> successorList = getSuccessorStates(state);
                for (int i = 0; i < successorList.Count; i++)
                {
                    GameState successor = (GameState)successorList.get(i);
                    int       minimumValueOfSuccessor = minValue(successor, ab.copy());
                    if (minimumValueOfSuccessor > v)
                    {
                        v = minimumValueOfSuccessor;
                        state.put("next", successor);
                    }
                    if (v >= ab.beta())
                    {
                        // System.Console.WriteLine("pruning from max");
                        return(v);
                    }
                    ab.setAlpha(Util.max(ab.alpha(), v));
                }
                return(v);
            }
        }
All Usage Examples Of AIMA.Core.Search.Adversarial.AlphaBeta::copy