protected internal override PuzzleState popFrontier()
        {
            //remove a state from the top of the fringe so that it can be searched.
            PuzzleState lState = Frontier.RemoveFirst();

            //add it to the list of searched states so that duplicates are recognised.
            Searched.AddLast(lState);

            return(lState);
        }
예제 #2
0
        protected internal override PuzzleState popFrontier()
        {
            //remove an item from the fringe to be searched
            PuzzleState thisState = Frontier.First.Value;

            Frontier.RemoveFirst();
            //Add it to the list of searched states, so that it isn't searched again
            Searched.AddLast(thisState);

            return(thisState);
        }