AIMA.Core.Environment.NQueens.NQueensGoalTest.isGoalState C# (CSharp) Метод

isGoalState() публичный Метод

public isGoalState ( Object state ) : bool
state Object
Результат bool
        public bool isGoalState(Object state)
        {
            NQueensBoard board = (NQueensBoard)state;
            return board.getNumberOfQueensOnBoard() == board.getSize()
                    && board.getNumberOfAttackingPairs() == 0;
        }
    }

Usage Example

Пример #1
0
        // END - Interface FitnessFunction
        //

        //
        // START - Interface GoalTest
        public bool isGoalState(Object state)
        {
            return(goalTest.isGoalState(getBoardForIndividual((String)state)));
        }
NQueensGoalTest