public class ConstantValueFunction extends java.lang.Object implements QFunction
QFunction
implementation that always returns a constant value. Useful for value function initialization.Modifier and Type | Field and Description |
---|---|
double |
value
The constant value to return for all initializations.
|
Constructor and Description |
---|
ConstantValueFunction()
Will cause this object to return 0 for all initialization values.
|
ConstantValueFunction(double value)
Will cause this object to return
value for all initialization values. |
Modifier and Type | Method and Description |
---|---|
double |
qValue(State s,
Action a)
Returns the
QValue for the given state-action pair. |
double |
value(State s)
Returns the value function evaluation of the given state.
|
public ConstantValueFunction()
public ConstantValueFunction(double value)
value
for all initialization values.value
- the value to return for all initializations.public double value(State s)
ValueFunction
value
in interface ValueFunction
s
- the state to evaluate.