/// <summary> /// Constructs the heuristic search procedure for the given planning problem. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic (if not specified, blind heuristic will be used).</param> /// <param name="loggingEnabled">Is logging of the search enabled?.</param> protected HeuristicSearch(ISearchableProblem problem, ISearchableHeuristic heuristic = null, bool loggingEnabled = false) { Problem = problem; Heuristic = heuristic ?? new BlindHeuristic(); LoggingEnabled = loggingEnabled; IsComplexHeuristic = Heuristic is ComplexHeuristic; }
/// <summary> /// Constructs the Beam search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> /// <param name="heap">Heap collection.</param> /// <param name="beamWidth">Beam width.</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> /// <param name="timeLimitOfSearch">Time limit of the search.</param> /// <param name="memoryLimitOfStates">Memory limit of searched nodes.</param> public BeamSearch(ISearchableProblem problem, ISearchableHeuristic heuristic, IHeap heap, int beamWidth, bool loggingEnabled, TimeSpan timeLimitOfSearch, long memoryLimitOfStates) : base(problem, heuristic, heap, loggingEnabled, timeLimitOfSearch, memoryLimitOfStates) { Candidates = new BeamSearchTransitionCandidates(problem, heuristic, beamWidth); }
/// <summary> /// Constructs the Beam search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic (if not specified, blind heuristic will be used).</param> /// <param name="heap">Heap collection (if not specified, red-black heap will be used).</param> /// <param name="beamWidth">Beam width (default width is 2).</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> public BeamSearch(ISearchableProblem problem, ISearchableHeuristic heuristic = null, IHeap heap = null, int beamWidth = 2, bool loggingEnabled = false) : base(problem, heuristic, heap, loggingEnabled) { Candidates = new BeamSearchTransitionCandidates(problem, heuristic, beamWidth); }
/// <summary> /// Constructs the Iterative Deepening A* search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> public IterativeDeepeningAStarSearch(ISearchableProblem problem, ISearchableHeuristic heuristic) : base(problem, heuristic) { // simple stack is used as a collection for open nodes (=> implies deep-first-search). OpenNodes = new SimpleStack(); }
/// <summary> /// Constructs the A* search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> /// <param name="heap">Heap collection.</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> /// <param name="timeLimitOfSearch">Time limit of the search.</param> /// <param name="memoryLimitOfStates">Memory limit of searched nodes.</param> public AStarSearch(ISearchableProblem problem, ISearchableHeuristic heuristic, IHeap heap, bool loggingEnabled, TimeSpan timeLimitOfSearch, long memoryLimitOfStates) : this(problem, heuristic, heap, loggingEnabled) { TimeLimitOfSearch = timeLimitOfSearch; MemoryLimitOfStates = memoryLimitOfStates; }
/// <summary> /// Constructs the A* search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic (if not specified, blind heuristic will be used).</param> /// <param name="heap">Heap collection (if not specified, red-black heap will be used).</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> public AStarSearch(ISearchableProblem problem, ISearchableHeuristic heuristic = null, IHeap heap = null, bool loggingEnabled = false) : base(problem, heuristic, loggingEnabled) { OpenNodes = heap ?? GetDefaultHeap(); }
/// <summary> /// Constructs the transition candidates collection. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> /// <param name="maxSize">Maximal size of the collection.</param> public BeamSearchTransitionCandidates(ISearchableProblem problem, ISearchableHeuristic heuristic, int maxSize) { Problem = problem; Heuristic = heuristic; MaxSize = maxSize; }
/// <summary> /// Constructs the multi-heuristic A* search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> public MultiHeuristicAStarSearch(ISearchableProblem problem, ISearchableHeuristic heuristic) : this(problem, new List <ISearchableHeuristic> { heuristic }) { }
/// <summary> /// Constructs the heuristic search procedure for the given planning problem. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> /// <param name="loggingEnabled">Is logging of the search enabled?.</param> /// <param name="timeLimitOfSearch">Time limit of the search.</param> /// <param name="memoryLimitOfStates">Memory limit of searched nodes.</param> protected HeuristicSearch(ISearchableProblem problem, ISearchableHeuristic heuristic, bool loggingEnabled, TimeSpan timeLimitOfSearch, long memoryLimitOfStates) : this(problem, heuristic, loggingEnabled) { TimeLimitOfSearch = timeLimitOfSearch; MemoryLimitOfStates = memoryLimitOfStates; }
/// <summary> /// Constructs the Hill-Climbing search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic.</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> /// <param name="timeLimitOfSearch">Time limit of the search.</param> /// <param name="memoryLimitOfStates">Memory limit of searched nodes.</param> public HillClimbingSearch(ISearchableProblem problem, ISearchableHeuristic heuristic, bool loggingEnabled, TimeSpan timeLimitOfSearch, long memoryLimitOfStates) : base(problem, heuristic, loggingEnabled, timeLimitOfSearch, memoryLimitOfStates) { }
/// <summary> /// Constructs the Hill-Climbing search procedure. /// </summary> /// <param name="problem">Planning problem.</param> /// <param name="heuristic">Heuristic (if not specified, blind heuristic will be used).</param> /// <param name="loggingEnabled">Is logging of the search enabled?</param> public HillClimbingSearch(ISearchableProblem problem, ISearchableHeuristic heuristic = null, bool loggingEnabled = false) : base(problem, heuristic, loggingEnabled) { }