AbstractIAFController Class Reference

Abstract class (interface) for robot controller that uses an integrate and fire neuron model. More...

#include <abstractiafcontroller.h>

Inherits AbstractController.

Inheritance diagram for AbstractIAFController:

Inheritance graph
[legend]
Collaboration diagram for AbstractIAFController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AbstractIAFController (const AbstractIAFControllerConf &conf=getDefaultConf())
virtual ~AbstractIAFController ()
virtual void init (int sensornumber, int motornumber, RandGen *randGen=0)
 ABSTRACTCONTROLLER INTERFACE.
virtual int getSensorNumber () const
virtual int getMotorNumber () const
virtual void step (const sensor *sensors, int sensornumber, motor *motors, int motornumber)
 performs one step (includes learning).
virtual void stepNoLearning (const sensor *sensors, int sensornumber, motor *motors, int motornumber)
 performs one step without learning.
virtual bool store (FILE *f) const
 STORABLE INTERFACE.
virtual bool restore (FILE *f)
 loads the object from the given file stream (binary).
virtual bool setParam (const paramkey &key, paramval val)
 CONFIGURABLE INTERFACE.

Static Public Member Functions

static AbstractIAFControllerConf getDefaultConf ()

Protected Member Functions

virtual void forwardStep (const sensor *sensors, int number_sensors, motor *motors, int number_motors)
 makes a forward step (without any learning)
void initMatrices ()
 inits the internal used matrices If you change something on dimensions, you should call this function.

Static Protected Member Functions

static double toTristateWithProbability (void *r, double x)
 returns -1 if probability is to low, otherwise 1 for mapP
static double toTristateWithThreshold (double x, double threshold)
 returns -1 if below -threshold, 0 if above -threshold and threshold, otherwise 1, for map2
static double dampToZero (void *r, double x)
 damps the value, if <0, damp value is added if >0, damp value is subtracted and threshold, otherwise 1, for map2
static double toZeroIfFired (double x, double fired)
static double toValueIfFired (void *r, double x, double fired)
static double toDualStateWithProbability (void *r, double x)
 returns 0 if probability is to low, otherwise 1 for mapP
static double toDualStateWithThreshold (double x, double threshold)
 returns 0 if below threshold, otherwise 1, for map2

Protected Attributes

AbstractIAFControllerConf conf
RandGenrandG
bool initialised
int sensorNumber
int motorNumber
double range
matrix::Matrix xI
matrix::Matrix xO
matrix::Matrix wI
matrix::Matrix wO
matrix::Matrix sumI
matrix::Matrix sumO
matrix::Matrix tI
matrix::Matrix tO

Detailed Description

Abstract class (interface) for robot controller that uses an integrate and fire neuron model.

Implements (assumes) that the sensor values are only 0 or 1. Implements standard configureable interface for some useful parameters like leakI and leakO (input and output layer)


Constructor & Destructor Documentation

AbstractIAFController ( const AbstractIAFControllerConf conf = getDefaultConf()  ) 

virtual ~AbstractIAFController (  )  [inline, virtual]


Member Function Documentation

static double dampToZero ( void *  r,
double  x 
) [inline, static, protected]

damps the value, if <0, damp value is added if >0, damp value is subtracted and threshold, otherwise 1, for map2

void forwardStep ( const sensor sensors,
int  number_sensors,
motor motors,
int  number_motors 
) [protected, virtual]

makes a forward step (without any learning)

static AbstractIAFControllerConf getDefaultConf (  )  [inline, static]

virtual int getMotorNumber (  )  const [inline, virtual]

Returns:
Number of motors the controller was initialised with or 0 if not initialised

Implements AbstractController.

virtual int getSensorNumber (  )  const [inline, virtual]

Returns:
Number of sensors the controller was initialised with or 0 if not initialised

Implements AbstractController.

void init ( int  sensornumber,
int  motornumber,
RandGen randGen = 0 
) [virtual]

ABSTRACTCONTROLLER INTERFACE.

Implements AbstractController.

void initMatrices (  )  [protected]

inits the internal used matrices If you change something on dimensions, you should call this function.

Note:
that all learned weights are lost.

virtual bool restore ( FILE *  f  )  [inline, virtual]

loads the object from the given file stream (binary).

Implements Storeable.

bool setParam ( const paramkey key,
paramval  val 
) [virtual]

CONFIGURABLE INTERFACE.

void step ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber 
) [virtual]

performs one step (includes learning).

Calculates motor commands from sensor inputs.

Parameters:
sensors sensors inputs scaled to [-1,1]
sensornumber length of the sensor array
motors motors outputs. MUST have enough space for motor values!
motornumber length of the provided motor array

Implements AbstractController.

void stepNoLearning ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber 
) [virtual]

performs one step without learning.

See also:
step

Implements AbstractController.

virtual bool store ( FILE *  f  )  const [inline, virtual]

STORABLE INTERFACE.

Implements Storeable.

static double toDualStateWithProbability ( void *  r,
double  x 
) [inline, static, protected]

returns 0 if probability is to low, otherwise 1 for mapP

static double toDualStateWithThreshold ( double  x,
double  threshold 
) [inline, static, protected]

returns 0 if below threshold, otherwise 1, for map2

static double toTristateWithProbability ( void *  r,
double  x 
) [inline, static, protected]

returns -1 if probability is to low, otherwise 1 for mapP

static double toTristateWithThreshold ( double  x,
double  threshold 
) [inline, static, protected]

returns -1 if below -threshold, 0 if above -threshold and threshold, otherwise 1, for map2

static double toValueIfFired ( void *  r,
double  x,
double  fired 
) [inline, static, protected]

static double toZeroIfFired ( double  x,
double  fired 
) [inline, static, protected]


Member Data Documentation

AbstractIAFControllerConf conf [protected]

bool initialised [protected]

int motorNumber [protected]

RandGen* randG [protected]

double range [protected]

int sensorNumber [protected]

matrix::Matrix sumI [protected]

matrix::Matrix sumO [protected]

matrix::Matrix tI [protected]

matrix::Matrix tO [protected]

matrix::Matrix wI [protected]

matrix::Matrix wO [protected]

matrix::Matrix xI [protected]

matrix::Matrix xO [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:02 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7