Reinforcement Learning Toolbox 2.0
last updated:
General
Documentation
Manual
Tutorial
Class Reference
Master Thesis
Examples
Related Papers
Downloads
Links
News
mailto:webmaster
Main Page     Class Hierarchy   Compound List   File List   Compound Members   File Members

CFeatureFunction Class Reference

The feature function for storing features in an double array. More...

#include <cfeaturefunction.h>

Inheritance diagram for CFeatureFunction:

CFeatureVFunction CFeatureVRegressionTreeFunction CVTable List of all members.


Public Member Functions

  CFeatureFunction (unsigned int numFeatures)
  creates a feature function with numFeatures features.

  CFeatureFunction (unsigned int numFeatures, double *features)
virtual  ~CFeatureFunction ()
void  randomInit (double min=-1.0, double max=1.0)
  Initializes the features with random values.

void  init (double value)
void  setFeature (CFeature *update, double value)
  Sets the feature to the specified value.

void  setFeature (unsigned int featureIndex, double value)
  Sets the feature to the specified value.

void  setFeatureList (CFeatureList *updateList, double value)
  Sets all features of the list to the specified values.

void  updateFeature (int feature, double difference)
  Adds the difference to the specified feature.

void  updateFeature (CFeature *update, double difference)
  Adds the difference to the specified feature.

void  updateFeatureList (CFeatureList *updateList, double value)
  Adds the difference to all features in the feature list.

virtual double  getFeature (unsigned int featureIndex)
  Returns the value of the feature.

virtual double  getFeatureList (CFeatureList *featureList)
  Returns the summed values of the features in the list.

virtual void  saveFeatures (FILE *stream)
virtual void  loadFeatures (FILE *stream)
virtual void  printFeatures ()
virtual unsigned int  getNumFeatures ()
void  postProcessWeights (double mean, double std)


Protected Attributes

unsigned int  numFeatures
  number of features

double *  features
  Feature double array.

bool  externFeatures

Detailed Description

The feature function for storing features in an double array.

This class is base class of all V-Functions which use features (used by linear approximators) and discrete states. A feature function is a table storing the values of every feature. The class provides direct access to the feature values through the functions setFeature, updateFeature and getFeature. It also provides functions for working with feature lists (setFeatureList, updateFeatureList, getFeatureList). When working with feature lists, not a single feature value, but all feature values of the features in the list get accessed, but each access is "multiplied" by the features activation factors. So, for example if you want to update the features of a feature list by the factor 5.0, and the feature list contains two features, feature nr. 80 and feature nr. 85, each having the same activation factor (often also called feature factor) of 0.5, than the update for both features would be 2.5. The same concept is true for setFeatureList and getFeatureList.


Constructor & Destructor Documentation

CFeatureFunction::CFeatureFunction unsigned int  numFeatures  ) 
 

creates a feature function with numFeatures features.

CFeatureFunction::CFeatureFunction unsigned int  numFeatures,
double *  features
 
virtual CFeatureFunction::~CFeatureFunction  )  [virtual]
 

Member Function Documentation

virtual double CFeatureFunction::getFeature unsigned int  featureIndex  )  [virtual]
 

Returns the value of the feature.

virtual double CFeatureFunction::getFeatureList CFeatureList featureList  )  [virtual]
 

Returns the summed values of the features in the list.

Each value of a feature gets multplied by the feature factor and then summed up.

virtual unsigned int CFeatureFunction::getNumFeatures  )  [virtual]
 
void CFeatureFunction::init double  value  ) 
 
virtual void CFeatureFunction::loadFeatures FILE *  stream  )  [virtual]
 
void CFeatureFunction::postProcessWeights double  mean,
double  std
 
virtual void CFeatureFunction::printFeatures  )  [virtual]
 
void CFeatureFunction::randomInit double  min = -1.0,
double  max = 1.0
 

Initializes the features with random values.

The random values are sampled from an uniform distribution between min and max.

virtual void CFeatureFunction::saveFeatures FILE *  stream  )  [virtual]
 
void CFeatureFunction::setFeature unsigned int  featureIndex,
double  value
 

Sets the feature to the specified value.

void CFeatureFunction::setFeature CFeature update,
double  value
 

Sets the feature to the specified value.

the value gets multiplied by the feature factor of update object.

void CFeatureFunction::setFeatureList CFeatureList updateList,
double  value
 

Sets all features of the list to the specified values.

calls setFeature(CFeature *update, double value), so the value gets multiplied by the feature factor for each feature.

void CFeatureFunction::updateFeature CFeature update,
double  difference
 

Adds the difference to the specified feature.

The difference is multiplied by the feature factor of the update object before updating.

void CFeatureFunction::updateFeature int  feature,
double  difference
 

Adds the difference to the specified feature.

void CFeatureFunction::updateFeatureList CFeatureList updateList,
double  value
 

Adds the difference to all features in the feature list.

Calls updateFeature(CFeature *update, double difference), so the difference is multiplied by the feature factor before updating.


Member Data Documentation

bool CFeatureFunction::externFeatures [protected]
 
double* CFeatureFunction::features [protected]
 

Feature double array.

unsigned int CFeatureFunction::numFeatures [protected]
 

number of features


The documentation for this class was generated from the following file: