public class FVRBFFeatureDatabase extends java.lang.Object implements FeatureDatabase
RBFFeatureDatabase
, this version takes as input
a StateToFeatureVectorGenerator
object so that states are first converted
to a double array and then provided to FVRBF
objects that operate
directly on the feature vector of the state. This can improve performance over the
RBFFeatureDatabase
which may require generating a feature vector
for states for each RBF unit. Therefore, for RBFs like ones that use Gaussian functions over
Euclidean distance metrics, this class is recommended. However, the standard RBFFeatureDatabase
may have the advantage of using RBF units that exploit the OO-MDP state representation for distance measures.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<GroundedAction,java.lang.Integer> |
actionFeatureMultiplier
A map for returning a multiplier to the number of RBF state features for each action.
|
protected StateToFeatureVectorGenerator |
fvGen
The state feature vector generator to supply to the RBFs
|
protected boolean |
hasOffset
Specifies whether an offset RBF unit with a constant response value is included in the feature set.
|
protected int |
nextActionMultiplier
The next action RBF size multiplier to use for the next newly seen action.
|
protected int |
nRbfs
The number of RBF units, not including an offset unit.
|
protected java.util.List<FVRBF> |
rbfs
The list of RBF units in this database
|
Constructor and Description |
---|
FVRBFFeatureDatabase(StateToFeatureVectorGenerator fvGen,
boolean hasOffset)
Initializes with an empty list of RBF units.
|
Modifier and Type | Method and Description |
---|---|
void |
addRBF(FVRBF rbf)
Adds the specified RBF unit to the list of RBF units.
|
void |
addRBFs(java.util.List<FVRBF> rbfs)
Adds all of the specified RBF units to this object's list of RBF units.
|
FVRBFFeatureDatabase |
copy()
Returns a deep copy of this feature database.
|
void |
freezeDatabaseState(boolean toggle)
Enable or disable the database from generating new features.
|
LinearVFA |
generateVFA(double defaultWeightValue)
Creates and returns a linear VFA object over this RBF feature database.
|
java.util.List<ActionFeaturesQuery> |
getActionFeaturesSets(State s,
java.util.List<GroundedAction> actions)
Returns non-zero action features for all of provided actions in state s.
|
protected int |
getActionMultiplier(GroundedAction ga)
This method returns the action multiplier for the specified grounded action.
|
java.util.List<StateFeature> |
getStateFeatures(State s)
Returns non-zero state features for a given state.
|
int |
numberOfFeatures()
Returns the number of features this database tracks.
|
protected StateToFeatureVectorGenerator fvGen
protected java.util.List<FVRBF> rbfs
protected int nRbfs
protected boolean hasOffset
protected java.util.Map<GroundedAction,java.lang.Integer> actionFeatureMultiplier
protected int nextActionMultiplier
public FVRBFFeatureDatabase(StateToFeatureVectorGenerator fvGen, boolean hasOffset)
fvGen
- the state feature vector generator to use to generate the feature vectors provided to RBFshasOffset
- if true, an offset RBF unit with a constant response value is included in the feature set.public void addRBF(FVRBF rbf)
rbf
- the RBF unit to add.public void addRBFs(java.util.List<FVRBF> rbfs)
rbfs
- the RBF units to add.public java.util.List<StateFeature> getStateFeatures(State s)
FeatureDatabase
getStateFeatures
in interface FeatureDatabase
s
- the state for which features should be returnedpublic java.util.List<ActionFeaturesQuery> getActionFeaturesSets(State s, java.util.List<GroundedAction> actions)
FeatureDatabase
getActionFeaturesSets
in interface FeatureDatabase
s
- the state for which features should be returnedactions
- the action set for which the action features should be returnedpublic void freezeDatabaseState(boolean toggle)
FeatureDatabase
freezeDatabaseState
in interface FeatureDatabase
public LinearVFA generateVFA(double defaultWeightValue)
defaultWeightValue
- the default feature weight value to use for all featuresprotected int getActionMultiplier(GroundedAction ga)
ga
- the grounded action for which the multiplier will be returnedpublic int numberOfFeatures()
FeatureDatabase
numberOfFeatures
in interface FeatureDatabase
public FVRBFFeatureDatabase copy()
FeatureDatabase
copy
in interface FeatureDatabase