protected class MAValueFunctionPlanner.BackupBasedQSource extends java.lang.Object implements QSourceForSingleAgent
QSourceForSingleAgent
implementation which stores a value function for an agent and produces Joint action Q-values
by marginalizing over the transition dynamics the reward and discounted next state value.QSourceForSingleAgent.HashBackedQSource
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
agentName
The agent name for which this value function is assigned.
|
protected java.util.Map<StateHashTuple,java.lang.Double> |
valueFunction
The tabular value function
|
Constructor and Description |
---|
MAValueFunctionPlanner.BackupBasedQSource(java.lang.String agentName)
Initializes a value function for the agent of the given name.
|
Modifier and Type | Method and Description |
---|---|
JAQValue |
getQValueFor(State s,
JointAction ja)
Returns a Q-value (represented with a
JAQValue object) stored for the given state and joint action. |
double |
getValue(StateHashTuple sh)
Returns the stored state value for hashed state sh, or creates an entry with an initial value corresponding to the
MAValueFunctionPlanner
instance's value function initialization object and returns that value if the the quried state has never previously been indexed. |
void |
setValue(StateHashTuple sh,
double v)
Sets the value of the state in this objects value function map.
|
protected java.lang.String agentName
protected java.util.Map<StateHashTuple,java.lang.Double> valueFunction
public MAValueFunctionPlanner.BackupBasedQSource(java.lang.String agentName)
agentName
- the name of the agent for which the value function corresponds.public JAQValue getQValueFor(State s, JointAction ja)
QSourceForSingleAgent
JAQValue
object) stored for the given state and joint action. Modification to the returned object
will directly modify the stored value that will be returned in subsequent calls to this method.getQValueFor
in interface QSourceForSingleAgent
s
- the Q-value's associated stateja
- the Q-value's associated joint acitonJAQValue
for the given state and joint action.public double getValue(StateHashTuple sh)
MAValueFunctionPlanner
instance's value function initialization object and returns that value if the the quried state has never previously been indexed.sh
- the state for which the value is to be returned.public void setValue(StateHashTuple sh, double v)
sh
- the hashed state for which the value is to be setv
- the value to set the state to.