public abstract class DeterministicPlanner extends OOMDPPlanner
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<StateHashTuple,GroundedAction> |
internalPolicy
Stores the action plan found by the planner as a deterministic policy
|
actions, containsParameterizedActions, 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,
StateHashFactory hashingFactory)
Initializes the planner.
|
protected void |
encodePlanIntoPolicy(SearchNode lastVisitedNode)
Encodes a solution path found by the planner into this class's internal policy structure.
|
boolean |
hasCachedPlanForState(State s)
Returns whether the planner 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 planner for the given state.
|
void |
resetPlannerResults()
Use this method to reset all planner results so that planning can be started fresh with a call to
OOMDPPlanner.planFromState(State)
as if no planning had ever been performed before. |
addNonDomainReferencedAction, getActions, getAllGroundedActions, getDebugCode, getDomain, getGamma, getHashingFactory, getRf, getRF, getTf, getTF, planFromState, plannerInit, setActions, setDebugCode, setDomain, setGamma, setRf, setTf, stateHash, toggleDebugPrinting, translateAction
protected StateConditionTest gc
protected java.util.Map<StateHashTuple,GroundedAction> internalPolicy
public void deterministicPlannerInit(Domain domain, RewardFunction rf, TerminalFunction tf, StateConditionTest gc, StateHashFactory 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 resetPlannerResults()
OOMDPPlanner
OOMDPPlanner.planFromState(State)
as if no planning had ever been performed before. Specifically, data produced from calls to the
OOMDPPlanner.planFromState(State)
will be cleared, but all other planner settings should remain the same.
This is useful if the reward function or transition dynamics have changed, thereby
requiring new results to be computed. If there were other objects this planner was provided that may have changed
and need to be reset, you will need to reset them yourself. For instance, if you told a planner to follow a policy
that had a temperature parameter decrease with time, you will need to reset the policy's temperature yourself.resetPlannerResults
in class OOMDPPlanner
public 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.