public class RBFFeatureDatabase extends java.lang.Object implements FeatureDatabase
FVRBFFeatureDatabase
instead, as it will be
more computationally efficient.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 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<RBF> |
rbfs
The list of RBF units in this database
|
Constructor and Description |
---|
RBFFeatureDatabase(boolean hasOffset)
Initializes with an empty list of RBF units.
|
Modifier and Type | Method and Description |
---|---|
void |
addRBF(RBF rbf)
Adds the specified RBF unit to the list of RBF units.
|
void |
addRBFs(java.util.List<RBF> rbfs)
Adds all of the specified RBF units to this object's list of RBF units.
|
RBFFeatureDatabase |
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 java.util.List<RBF> rbfs
protected int nRbfs
protected boolean hasOffset
protected java.util.Map<GroundedAction,java.lang.Integer> actionFeatureMultiplier
protected int nextActionMultiplier
public RBFFeatureDatabase(boolean hasOffset)
hasOffset
- if true, an offset RBF unit with a constant response value is included in the feature set.public void addRBF(RBF rbf)
rbf
- the RBF unit to add.public void addRBFs(java.util.List<RBF> 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 RBFFeatureDatabase copy()
FeatureDatabase
copy
in interface FeatureDatabase