/** {@inheritDoc} */ public Traversable<ResolutionState> getChildStateForOperator(Operator<ResolutionState> op) { return op.getOp(); }
/** * Evaluates a logical predicate. * * @param goalState The object to test for predicate membership. * * @return <tt>true</tt> if the object is a member of the predicate, <tt>false</tt> otherwise. */ public boolean evaluate(GoalState goalState) { return goalState.isGoal(); } }
/** {@inheritDoc} */ public void addStartState(ResolutionState startState) { resolutionSearch.addStartState(startState); }
public Successor<O> apply(Operator operator) { return new Successor<O>(getChildStateForOperator(operator), operator, costOf(operator)); } });
/** * Extracts the state from a search node. * * @param searchNode The search node. * * @return The state of the search node. */ public T apply(SearchNode<O, T> searchNode) { return searchNode.getState(); } }
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in an ordinary search node. */ public SearchNode<O, T> createSearchNode(T state) { return new SearchNode<O, T>(state); }
/** * Provides a default implementation of the {@link BoundProperty} interface to extract the depth as the bound * property. * * @param searchNode The search node to check the bounded property of. * * @return The search depth of the node. */ public float getBoundProperty(SearchNode searchNode) { return (float) searchNode.getDepth(); }
/** * Provides an implementation of the {@link BoundProperty} interface to extract the cost as the bound property. * * @param searchNode The search node to extract the bound property for. * * @return The path cost of the supplied search node. The bound property to control the bounded algorithm is the * path cost. */ public float getBoundProperty(SearchNode searchNode) { return searchNode.getPathCost(); } }
/** {@inheritDoc} */ public void setMaxSteps(int max) { resolutionSearch.setMaxSteps(max); }
/** {@inheritDoc} */ public Term getChildStateForOperator(Operator<Term> op) { return op.getOp(); }
public Successor<O> apply(Operator operator) { return new Successor<O>(getChildStateForOperator(operator), operator, costOf(operator)); } });
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in a search node. */ public SearchNode createSearchNode(T state) { return new SearchNode(state); }
/** * Evaluates a logical predicate. * * @param goalState The object to test for predicate membership. * * @return <tt>true</tt> if the object is a member of the predicate, <tt>false</tt> otherwise. */ public boolean evaluate(GoalState goalState) { return goalState.isGoal(); } }
/** * Provides a default implementation of the {@link BoundProperty} interface to extract the depth as the bound * property. * * @param searchNode The search node to check the bounded property of. * * @return The search depth of the node. */ public float getBoundProperty(SearchNode searchNode) { return (float) searchNode.getDepth(); }
/** {@inheritDoc} */ public Traversable<LabelState> getChildStateForOperator(Operator<LabelState> op) { return op.getOp(); }
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in a search node. */ public SearchNode createSearchNode(T state) { return new SearchNode(state); }
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in a search node. */ public SearchNode createSearchNode(T state) { return new SearchNode(state); }
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in a search node. */ public SearchNode createSearchNode(T state) { return new SearchNode(state); }
/** * This abstract method should be overriden to turn states into search nodes. Different implementation of queue * based algorithms can control the way they search by using different search node implementations. This method * allows the type of search node to be abstracted out of this search method to be supplied by concrete * implementations. * * @param state The state to create a {@link SearchNode} from. * * @return The {@link SearchNode} for the specified state. */ public SearchNode<O, T> createSearchNode(T state) { return new SearchNode<O, T>(state); }
/** * Creates the correct type of search nodes for this search. This search uses ordinary search nodes. * * @param state The search space state to create a search node for. * * @return The state encapsulated in an ordinary search node. */ public SearchNode<O, T> createSearchNode(T state) { return new SearchNode<O, T>(state); }