verve::Observation Class Reference

A simple data structure containing arrays of discrete and/or continuous sensory input data. More...

#include <Observation.h>

List of all members.

Public Member Functions

VERVE_DECL Observation ()
virtual VERVE_DECL ~Observation ()
virtual VERVE_DECL void VERVE_CALL init (const Agent &a)
virtual VERVE_DECL void VERVE_CALL init (const Observation &obs)
virtual VERVE_DECL void VERVE_CALL zeroInputData ()
virtual VERVE_DECL void VERVE_CALL copyInputData (const Observation &obs)
virtual VERVE_DECL unsigned
int VERVE_CALL 
getNumDiscreteInputs () const
virtual VERVE_DECL unsigned
int VERVE_CALL 
getNumContinuousInputs () const
virtual VERVE_DECL void VERVE_CALL setDiscreteValue (unsigned int index, unsigned int value)
virtual VERVE_DECL unsigned
int VERVE_CALL 
getDiscreteValue (unsigned int index) const
virtual VERVE_DECL const unsigned
int *VERVE_CALL 
getDiscreteInputData () const
virtual VERVE_DECL const unsigned
int *VERVE_CALL 
getDiscreteNumOptionsData () const
virtual VERVE_DECL void VERVE_CALL setContinuousValue (unsigned int index, real value)
virtual VERVE_DECL real VERVE_CALL getContinuousValue (unsigned int index) const
virtual VERVE_DECL const real
*VERVE_CALL 
getContinuousInputData () const
virtual VERVE_DECL const bool
*VERVE_CALL 
getContinuousCircularData () const
virtual VERVE_DECL unsigned
int VERVE_CALL 
getDiscreteInputNumOptions (unsigned int i) const
virtual VERVE_DECL bool VERVE_CALL getContinuousInputIsCircular (unsigned int i) const
virtual VERVE_DECL unsigned
int VERVE_CALL 
getContinuousResolution () const

Protected Attributes

unsigned int mNumDiscreteDimensions
unsigned int mNumContinuousDimensions
unsigned int * mDiscreteInputData
unsigned int * mDiscreteNumOptionsData
realmContinuousInputData
bool * mContinuousCircularData
unsigned mContinuousResolution


Detailed Description

A simple data structure containing arrays of discrete and/or continuous sensory input data.

An Observation is specific to a particular type of Agent (e.g. its number of inputs), so it must be initd to fit an Agent (or another Obsrevation) before use.

Definition at line 37 of file Observation.h.


Constructor & Destructor Documentation

verve::Observation::Observation  ) 
 

Definition at line 29 of file Observation.cpp.

References mContinuousCircularData, mContinuousInputData, mContinuousResolution, mDiscreteInputData, mDiscreteNumOptionsData, mNumContinuousDimensions, and mNumDiscreteDimensions.

verve::Observation::~Observation  )  [virtual]
 

Definition at line 40 of file Observation.cpp.

References mContinuousCircularData, mContinuousInputData, mDiscreteInputData, and mDiscreteNumOptionsData.


Member Function Documentation

void verve::Observation::copyInputData const Observation obs  )  [virtual]
 

Copies the given input data.

Definition at line 180 of file Observation.cpp.

References mDiscreteInputData, and mNumDiscreteDimensions.

Referenced by verve::Agent::planningSequence().

const bool * verve::Observation::getContinuousCircularData  )  const [virtual]
 

Returns a constant pointer to the array of data encoding which continuous dimensions are circular.

Definition at line 241 of file Observation.cpp.

References mContinuousCircularData.

const real * verve::Observation::getContinuousInputData  )  const [virtual]
 

Returns a constant pointer to the array of continuous input data.

Definition at line 236 of file Observation.cpp.

References mContinuousInputData.

Referenced by verve::RLModule::resetState(), verve::RLModule::update(), and verve::RLModule::updatePolicyOnly().

bool verve::Observation::getContinuousInputIsCircular unsigned int  i  )  const [virtual]
 

Returns whether the continuous input at the given index represents a circular data range.

Definition at line 251 of file Observation.cpp.

References mContinuousCircularData.

unsigned int verve::Observation::getContinuousResolution  )  const [virtual]
 

Returns the continuous sensor resolution.

Definition at line 256 of file Observation.cpp.

References mContinuousResolution.

real verve::Observation::getContinuousValue unsigned int  index  )  const [virtual]
 

Returns the value of the continuous data element at the given index.

Definition at line 231 of file Observation.cpp.

References mContinuousInputData.

const unsigned int * verve::Observation::getDiscreteInputData  )  const [virtual]
 

Returns a constant pointer to the array of discrete input data.

Definition at line 215 of file Observation.cpp.

References mDiscreteInputData.

Referenced by verve::RLModule::resetState(), verve::RLModule::update(), and verve::RLModule::updatePolicyOnly().

unsigned int verve::Observation::getDiscreteInputNumOptions unsigned int  i  )  const [virtual]
 

Returns the number of options for the discrete input at the given index.

Definition at line 246 of file Observation.cpp.

References mDiscreteNumOptionsData.

Referenced by verve::RBFInputData::init(), verve::PredictiveModel::predictAndTrain(), and verve::PredictiveModel::PredictiveModel().

const unsigned int * verve::Observation::getDiscreteNumOptionsData  )  const [virtual]
 

Returns a constant pointer to the array of data encoding the number of options for each discrete input.

Definition at line 220 of file Observation.cpp.

References mDiscreteNumOptionsData.

unsigned int verve::Observation::getDiscreteValue unsigned int  index  )  const [virtual]
 

Returns the value of the discrete data element at the given index.

Definition at line 210 of file Observation.cpp.

References mDiscreteInputData.

Referenced by verve::RBFInputData::init(), verve::PredictiveModel::predict(), and verve::PredictiveModel::predictAndTrain().

unsigned int verve::Observation::getNumContinuousInputs  )  const [virtual]
 

Returns the number of continuous input dimensions.

Definition at line 198 of file Observation.cpp.

References mNumContinuousDimensions.

unsigned int verve::Observation::getNumDiscreteInputs  )  const [virtual]
 

Returns the number of discrete input dimensions.

Definition at line 193 of file Observation.cpp.

References mNumDiscreteDimensions.

Referenced by verve::RBFInputData::init(), verve::PredictiveModel::predict(), verve::PredictiveModel::predictAndTrain(), and verve::PredictiveModel::PredictiveModel().

void verve::Observation::init const Observation obs  )  [virtual]
 

Initializes the Observation to match the given Observation.

Also copies the actual input data.

Definition at line 116 of file Observation.cpp.

References mDiscreteInputData, mDiscreteNumOptionsData, mNumContinuousDimensions, and mNumDiscreteDimensions.

void verve::Observation::init const Agent a  )  [virtual]
 

Initializes the Observation to fit the given Agent.

Definition at line 63 of file Observation.cpp.

References verve::Agent::getDescriptor(), verve::AgentDescriptor::getDiscreteSensorNumOptions(), verve::AgentDescriptor::getNumContinuousSensors(), verve::AgentDescriptor::getNumDiscreteSensors(), mDiscreteInputData, mDiscreteNumOptionsData, mNumContinuousDimensions, and mNumDiscreteDimensions.

Referenced by verve::Agent::Agent().

void verve::Observation::setContinuousValue unsigned int  index,
real  value
[virtual]
 

Sets the value of the continuous data element at the given index.

The value must be within [-1, 1].

Definition at line 225 of file Observation.cpp.

References mContinuousInputData.

void verve::Observation::setDiscreteValue unsigned int  index,
unsigned int  value
[virtual]
 

Sets the value of the discrete data element at the given index.

The value must be within [0, # of possible values - 1].

Definition at line 203 of file Observation.cpp.

References mDiscreteInputData, and mDiscreteNumOptionsData.

void verve::Observation::zeroInputData  )  [virtual]
 

Zeroes all input data.

Definition at line 167 of file Observation.cpp.

References mDiscreteInputData, and mNumDiscreteDimensions.

Referenced by verve::Agent::resetShortTermMemory().


Member Data Documentation

bool* verve::Observation::mContinuousCircularData [protected]
 

An array of data encoding which continuous dimensions are circular.

Definition at line 137 of file Observation.h.

Referenced by getContinuousCircularData(), getContinuousInputIsCircular(), Observation(), and ~Observation().

real* verve::Observation::mContinuousInputData [protected]
 

An array of continuous input data.

Definition at line 133 of file Observation.h.

Referenced by getContinuousInputData(), getContinuousValue(), Observation(), setContinuousValue(), and ~Observation().

unsigned verve::Observation::mContinuousResolution [protected]
 

The resolution used for each continuous input.

Definition at line 140 of file Observation.h.

Referenced by getContinuousResolution(), and Observation().

unsigned int* verve::Observation::mDiscreteInputData [protected]
 

An array of discrete input data.

Definition at line 126 of file Observation.h.

Referenced by copyInputData(), getDiscreteInputData(), getDiscreteValue(), init(), Observation(), setDiscreteValue(), zeroInputData(), and ~Observation().

unsigned int* verve::Observation::mDiscreteNumOptionsData [protected]
 

An array of data encoding the number of options for each discrete input.

Definition at line 130 of file Observation.h.

Referenced by getDiscreteInputNumOptions(), getDiscreteNumOptionsData(), init(), Observation(), setDiscreteValue(), and ~Observation().

unsigned int verve::Observation::mNumContinuousDimensions [protected]
 

The number of continuous input dimensions.

Definition at line 123 of file Observation.h.

Referenced by getNumContinuousInputs(), init(), and Observation().

unsigned int verve::Observation::mNumDiscreteDimensions [protected]
 

The number of discrete input dimensions.

Definition at line 120 of file Observation.h.

Referenced by copyInputData(), getNumDiscreteInputs(), init(), Observation(), and zeroInputData().


The documentation for this class was generated from the following files:
Generated on Tue Jan 24 21:46:39 2006 for Verve by  doxygen 1.4.6-NO