public class IDAStar extends DeterministicPlanner
DeterministicPlanner.PlanningFailedException
Modifier and Type | Field and Description |
---|---|
protected Heuristic |
heuristic
The heuristic to use
|
protected PrioritizedSearchNode.PSNComparator |
nodeComparator
The comparator to use for checking which nodes to expand first.
|
gc, internalPolicy
actions, debugCode, domain, gamma, hashingFactory, mapToStateIndex, rf, tf
Constructor and Description |
---|
IDAStar(Domain domain,
RewardFunction rf,
StateConditionTest gc,
HashableStateFactory hashingFactory,
Heuristic heuristic)
Initializes the valueFunction.
|
Modifier and Type | Method and Description |
---|---|
protected PrioritizedSearchNode |
FLimtedDFS(PrioritizedSearchNode lastNode,
double minR,
double cumulatedReward)
Recursive method to perform A* up to a f-score depth
|
protected boolean |
lastStateOnPathIsNew(PrioritizedSearchNode psn)
Returns true if the search node has not be visited previously on the current search path.
|
protected boolean |
planEndNode(SearchNode node)
Returns true if the search node wraps a goal state.
|
SDPlannerPolicy |
planFromState(State initialState)
Plans and returns a
SDPlannerPolicy . |
deterministicPlannerInit, encodePlanIntoPolicy, hasCachedPlanForState, planContainsOption, planHasDupilicateStates, querySelectedActionForState, resetSolver
addNonDomainReferencedAction, getActions, getAllGroundedActions, getDebugCode, getDomain, getGamma, getHashingFactory, getRf, getRF, getTf, getTF, setActions, setDebugCode, setDomain, setGamma, setHashingFactory, setRf, setTf, solverInit, stateHash, toggleDebugPrinting, translateAction
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNonDomainReferencedAction, getActions, getDebugCode, getDomain, getGamma, getHashingFactory, getRf, getRF, getTf, getTF, setActions, setDebugCode, setDomain, setGamma, setHashingFactory, setRf, setTf, solverInit, toggleDebugPrinting
protected Heuristic heuristic
protected PrioritizedSearchNode.PSNComparator nodeComparator
public IDAStar(Domain domain, RewardFunction rf, StateConditionTest gc, HashableStateFactory hashingFactory, Heuristic heuristic)
domain
- the domain in which to planrf
- the reward function that represents costs as negative rewardgc
- should evaluate to true for goal states; false otherwisehashingFactory
- the state hashing factory to useheuristic
- the planning heuristic. Should return non-positive values.public SDPlannerPolicy planFromState(State initialState)
SDPlannerPolicy
. If
a State
is not in the solution path of this planner, then
the SDPlannerPolicy
will throw
a runtime exception. If you want a policy that will dynamically replan for unknown states,
you should create your own DDPlannerPolicy
.initialState
- the initial state of the planning problemSDPlannerPolicy
.protected PrioritizedSearchNode FLimtedDFS(PrioritizedSearchNode lastNode, double minR, double cumulatedReward)
lastNode
- the node to expandminR
- the minimum cumulative reward at which to stop the search (in other terms the maximum cost)cumulatedReward
- the amount of reward accumulated at this nodeprotected boolean planEndNode(SearchNode node)
node
- the node to checkprotected boolean lastStateOnPathIsNew(PrioritizedSearchNode psn)
psn
- the search node to check.