public class VITutorial extends MDPSolver implements Planner, QFunction
QFunction.QFunctionHelper
Modifier and Type | Field and Description |
---|---|
protected int |
numIterations |
protected java.util.Map<HashableState,java.lang.Double> |
valueFunction |
protected ValueFunctionInitialization |
vinit |
actions, debugCode, domain, gamma, hashingFactory, mapToStateIndex, rf, tf
Constructor and Description |
---|
VITutorial(Domain domain,
RewardFunction rf,
TerminalFunction tf,
double gamma,
HashableStateFactory hashingFactory,
ValueFunctionInitialization vinit,
int numIterations) |
Modifier and Type | Method and Description |
---|---|
protected double |
bellmanEquation(State s) |
QValue |
getQ(State s,
AbstractGroundedAction a)
Returns the
QValue for the given state-action pair. |
java.util.List<QValue> |
getQs(State s)
Returns a
List of QValue objects for ever permissible action for the given input state. |
static void |
main(java.lang.String[] args) |
void |
performReachabilityFrom(State seedState) |
GreedyQPolicy |
planFromState(State initialState)
|
void |
resetSolver()
This method resets all solver results so that a solver can be restarted fresh
as if had never solved the MDP.
|
double |
value(State s)
Returns the value function evaluation of the given state.
|
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 java.util.Map<HashableState,java.lang.Double> valueFunction
protected ValueFunctionInitialization vinit
protected int numIterations
public VITutorial(Domain domain, RewardFunction rf, TerminalFunction tf, double gamma, HashableStateFactory hashingFactory, ValueFunctionInitialization vinit, int numIterations)
public double value(State s)
ValueFunction
value
in interface ValueFunction
s
- the state to evaluate.public java.util.List<QValue> getQs(State s)
QFunction
List
of QValue
objects for ever permissible action for the given input state.public QValue getQ(State s, AbstractGroundedAction a)
QFunction
QValue
for the given state-action pair.protected double bellmanEquation(State s)
public GreedyQPolicy planFromState(State initialState)
Planner
Planner
to begin planning from the specified initial State
.
It will then return an appropriate Policy
object that captured the planning results.
Note that typically you can use a variety of different Policy
objects
in conjunction with this Planner
to get varying behavior and
the returned Policy
is not required to be used.planFromState
in interface Planner
initialState
- the initial state of the planning problemPolicy
that captures the planning results from input State
.public void resetSolver()
MDPSolverInterface
resetSolver
in interface MDPSolverInterface
resetSolver
in class MDPSolver
public void performReachabilityFrom(State seedState)
public static void main(java.lang.String[] args)