public abstract class DeterministicPlanner extends MDPSolver implements Planner
DeterministicPlanner.PlanningFailedException runtime exception.| Modifier and Type | Class and Description |
|---|---|
class |
DeterministicPlanner.PlanningFailedException
Exception class for indicating that a solution failed to be found by the planning algorithm.
|
| Modifier and Type | Field and Description |
|---|---|
protected StateConditionTest |
gc
This State condition test should return true for goal states and false for non-goal states.
|
protected java.util.Map<HashableState,GroundedAction> |
internalPolicy
Stores the action plan found by the valueFunction as a deterministic policy
|
actions, debugCode, domain, gamma, hashingFactory, mapToStateIndex, rf, tf| Constructor and Description |
|---|
DeterministicPlanner() |
| Modifier and Type | Method and Description |
|---|---|
void |
deterministicPlannerInit(Domain domain,
RewardFunction rf,
TerminalFunction tf,
StateConditionTest gc,
HashableStateFactory hashingFactory)
Initializes the valueFunction.
|
protected void |
encodePlanIntoPolicy(SearchNode lastVisitedNode)
Encodes a solution path found by the valueFunction into this class's internal policy structure.
|
boolean |
hasCachedPlanForState(State s)
Returns whether the valueFunction has a plan solution from the provided state.
|
protected boolean |
planContainsOption(SearchNode lastVisitedNode)
Returns true if a solution path uses an option in its solution.
|
protected boolean |
planHasDupilicateStates(SearchNode lastVisitedNode)
Returns true if a solution path visits the same state multiple times.
|
GroundedAction |
querySelectedActionForState(State s)
Returns the action suggested by the valueFunction for the given state.
|
void |
resetSolver()
This method resets all solver results so that a solver can be restarted fresh
as if had never solved the MDP.
|
addNonDomainReferencedAction, getActions, getAllGroundedActions, getDebugCode, getDomain, getGamma, getHashingFactory, getRf, getRF, getTf, getTF, setActions, setDebugCode, setDomain, setGamma, setHashingFactory, setRf, setTf, solverInit, stateHash, toggleDebugPrinting, translateActionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitplanFromStateaddNonDomainReferencedAction, getActions, getDebugCode, getDomain, getGamma, getHashingFactory, getRf, getRF, getTf, getTF, setActions, setDebugCode, setDomain, setGamma, setHashingFactory, setRf, setTf, solverInit, toggleDebugPrintingprotected StateConditionTest gc
protected java.util.Map<HashableState,GroundedAction> internalPolicy
public void deterministicPlannerInit(Domain domain, RewardFunction rf, TerminalFunction tf, StateConditionTest gc, HashableStateFactory hashingFactory)
domain - the domain in which to plan.rf - the reward function to use (probably should be negative to be compatible with most forward search planners)tf - the terminal functiongc - test for goal conditions that should return true for goal states and false for non-goal states.hashingFactory - the hashing factory to use for states.public void resetSolver()
MDPSolverInterfaceresetSolver in interface MDPSolverInterfaceresetSolver in class MDPSolverpublic boolean hasCachedPlanForState(State s)
s - the state to test whether a plan solution currently exists.public GroundedAction querySelectedActionForState(State s)
s - the state for which the suggested action is to be returned.protected void encodePlanIntoPolicy(SearchNode lastVisitedNode)
DeterministicPlanner.PlanningFailedException runtime exception is thrown.lastVisitedNode - the last search node in the solution path, which should contain the goal state.protected boolean planContainsOption(SearchNode lastVisitedNode)
lastVisitedNode - the last search node in the solution path, which should contain the goal state.protected boolean planHasDupilicateStates(SearchNode lastVisitedNode)
lastVisitedNode - the last search node in the solution path, which should contain the goal state.