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

setBeta() public method

public setBeta ( int beta ) : void
beta int
return void
        public void setBeta(int beta)
        {
            this.beta = beta;
        }

Usage Example

Beispiel #1
0
        public int minValue(GameState state, AlphaBeta ab)
        {
            int v = int.MAX_VALUE;

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