public class DenseCrossProductFeatures extends java.lang.Object implements DenseStateActionFeatures
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<Action,java.lang.Integer> |
actionOffset
A feature index offset for each action when using Q-value function approximation.
|
protected int |
numActions
The number of possible actions
|
protected DenseStateFeatures |
stateFeatures
The state features
|
Constructor and Description |
---|
DenseCrossProductFeatures(DenseStateFeatures stateFeatures,
int numActions) |
DenseCrossProductFeatures(DenseStateFeatures stateFeatures,
int numActions,
java.util.Map<Action,java.lang.Integer> actionOffset) |
Modifier and Type | Method and Description |
---|---|
DenseStateActionFeatures |
copy()
Returns a copy of this
DenseStateActionFeatures |
double[] |
features(State s,
Action a)
Returns a feature vector represented as a double array for a given input state-action pair.
|
int |
getActionOffset(Action a) |
int |
getNumActions() |
DenseStateFeatures |
getStateFeatures() |
void |
setNumActions(int numActions) |
void |
setStateFeatures(DenseStateFeatures stateFeatures) |
protected DenseStateFeatures stateFeatures
protected int numActions
protected java.util.Map<Action,java.lang.Integer> actionOffset
public DenseCrossProductFeatures(DenseStateFeatures stateFeatures, int numActions)
public DenseCrossProductFeatures(DenseStateFeatures stateFeatures, int numActions, java.util.Map<Action,java.lang.Integer> actionOffset)
public DenseStateFeatures getStateFeatures()
public void setStateFeatures(DenseStateFeatures stateFeatures)
public int getNumActions()
public void setNumActions(int numActions)
public double[] features(State s, Action a)
DenseStateActionFeatures
features
in interface DenseStateActionFeatures
s
- the input statea
- the input actionpublic DenseStateActionFeatures copy()
DenseStateActionFeatures
DenseStateActionFeatures
copy
in interface DenseStateActionFeatures
DenseStateActionFeatures
public int getActionOffset(Action a)