Feature Class Reference

#include <Feature.h>

Inheritance diagram for Feature:

PersistantFeature PowerFeature WlanActiveModeFeature AbstractStringFeature NumericalContinuousFeature NumericalDiscreteFeature TimeFeature AbstractStringListFeature ActiveWindowFeature GSMCellFeature WlanActiveEssidFeature WlanActiveMacAddressFeature AudioBandFeature AudioMeanFeature WlanActiveSignalLevelFeature AudioPeakFeature BluetoothNumPeersFeature WlanNumPeersFeature List of all members.

Public Types

enum  FeatureType {
  boolean, nominal, ordinal, numerical_discrete,
  numerical_continuous
}

Public Member Functions

virtual ~Feature ()
virtual FeatureType getType () const =0
virtual const string getName () const =0
virtual double getPosition () const =0
bool isExternalizable ()
virtual double getDistance (Feature *f) const =0
virtual void moveTowards (Feature *f, double factor)=0
virtual Featureclone () const =0
virtual string serialize () const =0
virtual void unserialize (string value)=0
virtual void aggregate (aggregatelist samples)=0
virtual string toString () const =0

Protected Member Functions

 Feature (bool ext)
 Feature ()

Protected Attributes

const bool externalize

Detailed Description

Feature interface

A feature represents a single dimension in the cluster space and implements the necessary funcionality to compare features of the same kind and measure distances between them. A feature is identified by a name which has to be unique in the scope of its feature provider. It abstracts the type and structure of the underlying sensor data and can also apply arbitrary data processing and transformation to the raw sensor data. Typically, a sensor (i.e. a FeatureProvider) will provide multiple features which are extracted using domain-specific knowledge.

A feature will also be referenced as sample. Samples are a more generic from of a feature only containing information about their position and without information about corresponding neighbours, age, error, etc.

See also:
FeatureProvider


Member Enumeration Documentation

enum Feature::FeatureType
 

Possible feature types


Constructor & Destructor Documentation

Feature::Feature bool  ext  )  [inline, protected]
 

Constructor for usage in PerstantFeature

Sets the externalization flag to the given value.

See also:
extnlze

Feature::Feature  )  [inline, protected]
 

Default constructor

Sets the externalization flag to false.

See also:
extnlze

virtual Feature::~Feature  )  [inline, virtual]
 

Destructor

Empty virtual destructor to have an entry in the implementing classes method table. This ensures that derived classes get destructed correctly.


Member Function Documentation

virtual void Feature::aggregate aggregatelist  samples  )  [pure virtual]
 

Aggregate a sample values from other sources

Parameters:
samples A list of <timestamp, sample> tuples.

Implemented in AbstractStringFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual Feature* Feature::clone  )  const [pure virtual]
 

Clone a feature

A feature must be able to clone itself. This is typically implemented with a copy constructor, but should return a new object.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual double Feature::getDistance Feature f  )  const [pure virtual]
 

Calculates the distance between two features

Parameters:
f Feature used for distance measurement.
Returns:
Distance between the two samples. The return value has to be in the interval [0; 1] to guarantee comparability among samples of different features.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual const string Feature::getName  )  const [pure virtual]
 

Query a features name

Returns:
Name of the Feature in the format "Featureprovider.Feature"

Implemented in AbstractStringFeature, AbstractStringListFeature, ActiveWindowFeature, AudioBandFeature, AudioMeanFeature, AudioPeakFeature, BluetoothPeersFeature, BluetoothNumPeersFeature, GSMCellFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, SystemCommandStringListFeature, TimeFeature, WlanActiveEssidFeature, WlanActiveMacAddressFeature, WlanActiveModeFeature, WlanActiveSignalLevelFeature, WlanPeersFeature, and WlanNumPeersFeature.

virtual double Feature::getPosition  )  const [pure virtual]
 

Query a features position

Returns:
The distance to the origin. Every implementation must take care that only values in the interval [0; 1] are returned.
Remarks:
This function is only for the purpose of internal search operations and visualisation and should not be used in any other context.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual FeatureType Feature::getType  )  const [pure virtual]
 

Query a features type

Returns:
The type of the Feature.

Implemented in AbstractStringFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

bool Feature::isExternalizable  )  [inline]
 

Query externalization flag

Returns:
true if the feature is externalizeable ( i.e. it has persistend data that should be stored across restarts), false otherwise.

virtual void Feature::moveTowards Feature f,
double  factor
[pure virtual]
 

Move feature

Moves the feature towards a given sample value by the specified factor (factor times the distance). If the factor is 0, the old feature value must not change. If the factor is 1, the new feature value should be equivalent to the sample s.

Parameters:
f Feature used for distance measurement.
factor Distance weight.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual string Feature::serialize  )  const [pure virtual]
 

Serialize a samples data to a string

Returns:
String representation of the samples data.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.

virtual string Feature::toString  )  const [pure virtual]
 

This is only for testing.

Implemented in AbstractStringFeature, AbstractStringListFeature, ActiveWindowFeature, AudioBandFeature, AudioMeanFeature, AudioPeakFeature, BluetoothPeersFeature, BluetoothNumPeersFeature, GSMCellFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, SystemCommandStringListFeature, TimeFeature, WlanActiveEssidFeature, WlanActiveMacAddressFeature, WlanActiveModeFeature, WlanActiveSignalLevelFeature, WlanPeersFeature, and WlanNumPeersFeature.

virtual void Feature::unserialize string  value  )  [pure virtual]
 

Unserialize a samples data from a string

Parameters:
value String representation of the samples data.

Implemented in AbstractStringFeature, AbstractStringListFeature, NumericalDiscreteFeature, NumericalContinuousFeature, PowerFeature, TimeFeature, and WlanActiveModeFeature.


Member Data Documentation

const bool Feature::externalize [protected]
 

Externalization flag

If true, then this feature has persistent data which should be preserved across restarts of the application (e.g. a list of already seen feature values for nominal and ordinal types or maximum and minimum values for numerical types).

For all persistant features, the object should be cast to PersistentFeature, because only subclasses of this type are (by policy) allowed to set this variable to true.

See also:
PersistantFeature


The documentation for this class was generated from the following file:
Generated on Mon Jun 5 10:20:49 2006 for Intelligence.kdevelop by  doxygen 1.4.6