public BreadthFirstSearch(QueueSearch <S, A> impl) : base(impl, CollectionFactory.CreateFifoQueue <Node <S, A> >()) { // Goal test is to be applied to each node when it is generated // rather than when it is selected for expansion. impl.setEarlyGoalTest(true); }
public BreadthFirstSearch(QueueSearch search) { // Goal test is to be applied to each node when it is generated // rather than when it is selected for expansion. search.SetCheckGoalBeforeAddingToFrontier(true); this.search = search; }
public UniformCostSearch(QueueSearch search) { this.search = search; if (search is GraphSearch) { ((GraphSearch)search).ReplaceFrontierNodeAtStateCostFunction = G; } }
public BreadthFirstSearch(QueueSearch search) { this._search = search; }
public AStarSearch(QueueSearch search) { this._search = search; }
// Constructor que recibe el tipo de búsqueda que realizar // Soporta tamto la versión para grafos como para árboles simplemente pasándole el ejemplar correspondiente de TreeSearch o GraphSearch en el constructor. public DepthFirstSearch(QueueSearch search) { this.search = search; // Esta búsqueda aplica la prueba de objetivo a cada nodo cuando es seleccionado para expandirse, no antes }
public AStarSearch(QueueSearch search, HeuristicFunction hf) : base(search, new AStarEvaluationFunction(hf)) { }
/** * Creates a search instance. * * @param strategy * search strategy. See static constants. * @param qSearchImpl * queue search implementation: e.g. {@link #TREE_SEARCH}, {@link #GRAPH_SEARCH} * */ public ISearchForActions <S, A> createSearch <S, A>(int strategy, int qSearchImpl, IToDoubleFunction <Node <S, A> > h) { QueueSearch <S, A> qs = null; ISearchForActions <S, A> result = null; switch (qSearchImpl) { case TREE_SEARCH: qs = new TreeSearch <S, A>(); break; case GRAPH_SEARCH: qs = new GraphSearch <S, A>(); break; case GRAPH_SEARCH_RED_FRONTIER: qs = new GraphSearchReducedFrontier <S, A>(); break; case GRAPH_SEARCH_BFS: qs = new GraphSearchBFS <S, A>(); break; case BIDIRECTIONAL_SEARCH: qs = new BidirectionalSearch <S, A>(); break; } switch (strategy) { case DF_SEARCH: result = new DepthFirstSearch <S, A>(qs); break; case BF_SEARCH: result = new BreadthFirstSearch <S, A>(qs); break; case ID_SEARCH: result = new IterativeDeepeningSearch <S, A>(); break; case UC_SEARCH: result = new UniformCostSearch <S, A>(qs); break; case GBF_SEARCH: result = new GreedyBestFirstSearch <S, A>(qs, h); break; case ASTAR_SEARCH: result = new AStarSearch <S, A>(qs, h); break; case RBF_SEARCH: result = new RecursiveBestFirstSearch <S, A>(new AStarSearch <S, A> .EvalFunction(h)); break; case RBF_AL_SEARCH: result = new RecursiveBestFirstSearch <S, A>(new AStarSearch <S, A> .EvalFunction(h), true); break; case HILL_SEARCH: result = new HillClimbingSearch <S, A>(h); break; } return(result); }
/** * Combines UniformCostSearch queue definition with the specified * search space exploration strategy. */ public UniformCostSearch(QueueSearch <S, A> impl) : base(impl, CollectionFactory.CreatePriorityQueue <Node <S, A> >(new UniformCostSearchComparer())) { }
/** * Constructs a greedy best-first search from a specified search space * exploration strategy and a heuristic function. * * @param impl * a search space exploration strategy (e.g. TreeSearch, * GraphSearch). * @param h * a heuristic function <em>h(n)</em>, which estimates the * cheapest path from the state at node <em>n</em> to a goal * state. */ public GreedyBestFirstSearch(QueueSearch <S, A> impl, IToDoubleFunction <Node <S, A> > h) : base(impl, new EvalFunction(h)) { }
public GreedyBestFirstSearch(QueueSearch search, IHeuristicFunction hf) : base(search, new GreedyBestFirstEvaluationFunction(hf)) { }
protected QueueBasedSearch(QueueSearch <S, A> impl, ICollection <Node <S, A> > queue) { this.impl = impl; this.frontier = queue; }
/** * Constructs an A* search from a specified search space exploration * strategy and a heuristic function. * * @param impl a search space exploration strategy (e.g. TreeSearch, GraphSearch). * @param h a heuristic function <em>h(n)</em>, which estimates the cost * of the cheapest path from the state at node <em>n</em> to a * goal state. */ public AStarSearch(QueueSearch <S, A> impl, IToDoubleFunction <Node <S, A> > h) : base(impl, new EvalFunction(h)) { }
public BestFirstSearch(QueueSearch search, IEvaluationFunction ef) { this.search = search; evaluationFunction = ef; }
/** * Constructs a best first search from a specified search problem and * evaluation function. * * @param impl * a search space exploration strategy. * @param evalFn * an evaluation function, which returns a number purporting to * describe the desirability (or lack thereof) of expanding a * node. */ public BestFirstSearch(QueueSearch <S, A> impl, IToDoubleFunction <Node <S, A> > evalFn) : base(impl, CollectionFactory.CreatePriorityQueue <Node <S, A> >(new BestFirstSearchComparer(evalFn))) { this.evalFn = evalFn; }
// Constructor que recibe el tipo de búsqueda que realizar // Soporta tamto la versión para grafos como para árboles simplemente pasándole el ejemplar correspondiente de TreeSearch o GraphSearch en el constructor. public BreadthFirstSearch(QueueSearch search) { this.search = search; // Esta búsqueda aplica la prueba de objetivo a cada nodo cuando es generado, ANTES DE AÑADIRSE A LA FRONTERA y no cuando es seleccionado para expandirse this.search.TestGoalBeforeAddToFrontier = true; }
public DepthFirstSearch(QueueSearch search) { this._search = search; }
public DepthFirstSearch(QueueSearch <S, A> impl) : base(impl, CollectionFactory.CreateLifoQueue <Node <S, A> >()) { }
public GreedyBestFirstSearch(QueueSearch search) { this._search = search; }