#include <abstractiafcontroller.h>
Inherits AbstractController.
Inheritance diagram for AbstractIAFController:
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 |
RandGen * | randG |
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 |
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)
AbstractIAFController | ( | const AbstractIAFControllerConf & | conf = getDefaultConf() |
) |
virtual ~AbstractIAFController | ( | ) | [inline, virtual] |
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] |
Implements AbstractController.
virtual int getSensorNumber | ( | ) | const [inline, virtual] |
Implements AbstractController.
void init | ( | int | sensornumber, | |
int | motornumber, | |||
RandGen * | randGen = 0 | |||
) | [virtual] |
void initMatrices | ( | ) | [protected] |
inits the internal used matrices If you change something on dimensions, you should call this function.
virtual bool restore | ( | FILE * | f | ) | [inline, virtual] |
performs one step (includes learning).
Calculates motor commands from sensor inputs.
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.
virtual bool store | ( | FILE * | f | ) | const [inline, virtual] |
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] |
AbstractIAFControllerConf conf [protected] |
bool initialised [protected] |
int motorNumber [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] |