![JAR search and dependency download from the Maven repository](/logo.png)
com.thesett.aima.search.spi.QueueSearchState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of search Show documentation
Show all versions of search Show documentation
Search code developed from 'Artificial Intelligence a Modern Approach', Prentice Hall.
The newest version!
/*
* Copyright The Sett Ltd, 2005 to 2014.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thesett.aima.search.spi;
import java.util.Collection;
import java.util.Queue;
import com.thesett.aima.search.SearchNode;
import com.thesett.aima.search.Traversable;
import com.thesett.common.util.logic.UnaryPredicate;
/**
* QueueSearchState is used to abstract the queue creation and search node creation process out of a search algorithm.
* An argument that implements this interface is passed to classes that implement the
* {@link QueueSearchAlgorithm#search} method so that they may create start queues without being aware of the specific
* implementation of the queue and search nodes types being used.
*
* The enqueueing of start states usually takes place when a {@link QueueBasedSearchMethod#search} method is called,
* however, subsequent calls to this method to generate further goal states after the first one is found should not
* re-enqueue the start states but should maintain the existing search position to carry on from. For this reason there
* is a flag method {@link #isEnqueuedOnce} that returns true once the {@link #enqueueStartStates} method has been
* called.
*
* The goal predicate for the queue based search, and the number of search steps taken are also encapsulated by this
* state. Specific search algorithms must interface to the queue based search, in order to obtain the goal predicate,
* and keep count of the number of steps taken, through this interface.
*
*
CRC Card
* Responsibilities
* Turn start states into search nodes of the correct type for a search algorithm.
* Record and supply statistics about the number of search steps taken during the running of a search
* algorithm.
* Indicate whether or not start states have already been enqueued.
* Provide the goal predicate for the search.
*
*
* @author Rupert Smith
*/
public interface QueueSearchState© 2015 - 2025 Weber Informatics LLC | Privacy Policy