public class IDAStar extends DeterministicPlanner
If a terminal function is provided via the setter method defined for OO-MDPs, then the BestFirst search algorithm will not expand any nodes that are terminal states, as if there were no actions that could be executed from that state. Note that terminal states are not necessarily the same as goal states, since there could be a fail condition from which the agent cannot act, but that is not explicitly represented in the transition dynamics.
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
actionTypes, debugCode, domain, gamma, hashingFactory, model, usingOptionModel
Constructor and Description |
---|
IDAStar(SADomain domain,
StateConditionTest gc,
HashableStateFactory hashingFactory,
Heuristic heuristic)
Initializes.
|
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
addActionType, applicableActions, getActionTypes, getDebugCode, getDomain, getGamma, getHashingFactory, getModel, setActionTypes, setDebugCode, setDomain, setGamma, setHashingFactory, setModel, solverInit, stateHash, toggleDebugPrinting
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addActionType, getActionTypes, getDebugCode, getDomain, getGamma, getHashingFactory, getModel, setActionTypes, setDebugCode, setDomain, setGamma, setHashingFactory, setModel, solverInit, toggleDebugPrinting
protected Heuristic heuristic
protected PrioritizedSearchNode.PSNComparator nodeComparator
public IDAStar(SADomain domain, StateConditionTest gc, HashableStateFactory hashingFactory, Heuristic heuristic)
domain
- the domain in which to plangc
- 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.