public class LimitedMemoryDFS extends DFS
If a terminal function is provided via the setter method defined for OO-MDPs, then the 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.
|Modifier and Type||Field and Description|
A queue for storing the most recently expanded nodes.
the size of the memory; that is, the number of recently expanded search nodes the valueFunction will remember.
Stores the depth at which each state in the memory was explored.
maintainClosed, maxDepth, numVisted, optionsFirst, rand
|Constructor and Description|
Constructor for memory limited DFS
|Modifier and Type||Method and Description|
Runs DFS from a given search node, keeping track of its current depth.
Plans and returns a
DFSInit, getNumVisited, numOptionsInGAs, resetSolver, setOptionsFirst, shuffleGroundedActions, sortActionsWithOptionsFirst
deterministicPlannerInit, encodePlanIntoPolicy, hasCachedPlanForState, planContainsOption, planHasDupilicateStates, querySelectedActionForState
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
protected int memorySize
protected java.util.LinkedList<HashableState> memoryQueue
protected java.util.Map<HashableState,java.lang.Integer> memoryStateDepth
public LimitedMemoryDFS(SADomain domain, StateConditionTest gc, HashableStateFactory hashingFactory, int maxDepth, boolean maintainClosed, boolean optionsFirst, int memorySize)
domain- the domain in which to plan
gc- indicates the goal states
hashingFactory- the state hashing factory to use
maxDepth- depth limit of DFS. -1 specifies no limit.
maintainClosed- whether to maintain a closed list or not
optionsFirst- whether to explore paths generated by options first.
memorySize- the number of most recently expanded nodes to remember.
public SDPlannerPolicy planFromState(State initialState)
SDPlannerPolicy. If a
Stateis not in the solution path of this planner, then the
SDPlannerPolicywill throw a runtime exception. If you want a policy that will dynamically replan for unknown states, you should create your own
protected SearchNode dfs(SearchNode n, int depth, java.util.Set<HashableState> statesOnPath)