/// <summary>Initializes a new <see cref="DepthLimitedSearch{S,A}"/>.</summary> public DepthLimitedSearch(IGraphSearchable <StateType, ActionType> problem, int depthLimit) : base(problem, false) { if (depthLimit < 0) { throw new ArgumentOutOfRangeException("Depth limit must not be negative."); } DepthLimit = depthLimit; }
/// <summary>Initializes the graph search with a problem instance.</summary> protected GraphSearchBase(IGraphSearchable <StateType, ActionType> problem) { if (problem == null) { throw new ArgumentNullException(); } Problem = problem; }
/// <summary>Initializes a new <see cref="UniformCostSearch{S,A}"/>.</summary> public UniformCostSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, false) { }
/// <summary>Initializes a new <see cref="IterativeDeepeningAStarSearch{S,A}"/>.</summary> public IterativeDeepeningAStarSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, true) { }
/// <summary>Initializes a new <see cref="GreedyBestFirstSearch{S,A}"/>.</summary> public GreedyBestFirstSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, true) { }
/// <summary>Initializes a new <see cref="DepthFirstSearch{S,A}"/>.</summary> public DepthFirstSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, int.MaxValue) { }
/// <summary>Initializes a new <see cref="DepthBasedSearch{S,A}"/>.</summary> protected DepthBasedSearch(IGraphSearchable <StateType, ActionType> problem, bool usesHeuristic) : base(problem, usesHeuristic) { }
/// <summary>Initializes a new <see cref="BreadthFirstSearch{S,A}"/>.</summary> public BreadthFirstSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, false) { }
/// <summary>Initializes a new <see cref="AStarSearch{S,A}"/>.</summary> public AStarSearch(IGraphSearchable <StateType, ActionType> problem) : base(problem, true) { }
/// <summary>Initializes the single-queue search base with the given problem.</summary> /// <param name="problem">The problem instance to be solved.</param> /// <param name="usesHeuristic">Determines whether heuristic information is required by the search. If not, it won't /// be gathered. Passing true also has the effect of disabling bidirectional searches, because bidirectional /// searching with heuristics is not yet implemented. /// </param> protected SingleQueueSearchBase(IGraphSearchable <StateType, ActionType> problem, bool usesHeuristic) : base(problem) { this.BidiProblem = problem as IBidirectionallySearchable <StateType, ActionType>; this.useHeuristic = usesHeuristic; }