public SearchResult search ( final S goalState ) { return search ( new Predicate < N > ( ) { @ Override public boolean apply ( N n ) { if ( goalState != null ) { return n . state ( ) . equals ( goalState ) ; } return false ; } } ) ; }
Run the algorithm until the goal is found or no more states are available .