Sos Class Reference
This controller implements the standard algorihm described the Chapter 5 (Homeokinesis) of book "The Playful Machine".
More...
#include <sos.h>
Inherits AbstractController.
List of all members.
Public Member Functions |
| | Sos (double init_feedback_strength=1.0) |
| virtual void | init (int sensornumber, int motornumber, RandGen *randGen=0) |
| | initialisation of the controller with the given sensor/ motornumber Must be called before use.
|
| virtual | ~Sos () |
| virtual int | getSensorNumber () const |
| | returns the number of sensors the controller was initialised with or 0 if not initialised
|
| virtual int | getMotorNumber () const |
| | returns the mumber of motors the controller was initialised with or 0 if not initialised
|
| virtual void | step (const sensor *, int number_sensors, motor *, int number_motors) |
| | performs one step (includes learning).
|
| virtual void | stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors) |
| | performs one step without learning. Calulates motor commands from sensor inputs.
|
| virtual bool | store (FILE *f) const |
| | stores the controller values to a given file.
|
| virtual bool | restore (FILE *f) |
| | loads the controller values from a given file.
|
| virtual matrix::Matrix | getA () |
| virtual void | setA (const matrix::Matrix &A) |
| virtual matrix::Matrix | getC () |
| virtual void | setC (const matrix::Matrix &C) |
| virtual matrix::Matrix | geth () |
| virtual void | seth (const matrix::Matrix &h) |
Protected Member Functions |
| virtual void | learn () |
| | learn values model and controller (A,b,C,h)
|
Static Protected Member Functions |
| static double | g (double z) |
| | neuron transfer function
|
| static double | g_s (double z) |
| | derivative of g
|
| static double | clip (double r, double x) |
| | function that clips the second argument to the interval [-first,first]
|
| static double | one_over (double x) |
| | calculates the inverse the argument (useful for Matrix::map)
|
Protected Attributes |
| unsigned short | number_sensors |
| unsigned short | number_motors |
| matrix::Matrix | A |
| matrix::Matrix | C |
| matrix::Matrix | h |
| matrix::Matrix | b |
| matrix::Matrix | L |
| matrix::Matrix | y_buffer [buffersize] |
| matrix::Matrix | x_buffer [buffersize] |
| matrix::Matrix | v_avg |
| matrix::Matrix | x |
| matrix::Matrix | x_smooth |
| int | t |
| bool | TLE |
| bool | loga |
| double | init_feedback_strength |
| paramval | creativity |
| paramval | epsC |
| paramval | epsA |
| paramint | s4avg |
| paramint | s4delay |
Static Protected Attributes |
| static const unsigned short | buffersize = 10 |
Detailed Description
This controller implements the standard algorihm described the Chapter 5 (Homeokinesis) of book "The Playful Machine".
Constructor & Destructor Documentation
| Sos |
( |
double |
init_feedback_strength = 1.0 |
) |
|
Member Function Documentation
| static double clip |
( |
double |
r, |
|
|
double |
x | |
|
) |
| | [inline, static, protected] |
function that clips the second argument to the interval [-first,first]
| static double g |
( |
double |
z |
) |
[inline, static, protected] |
| static double g_s |
( |
double |
z |
) |
[inline, static, protected] |
| virtual int getMotorNumber |
( |
|
) |
const [inline, virtual] |
returns the mumber of motors the controller was initialised with or 0 if not initialised
Implements AbstractController.
| virtual int getSensorNumber |
( |
|
) |
const [inline, virtual] |
returns the 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] |
initialisation of the controller with the given sensor/ motornumber Must be called before use.
The random generator is optional.
Implements AbstractController.
| void learn |
( |
|
) |
[protected, virtual] |
learn values model and controller (A,b,C,h)
| static double one_over |
( |
double |
x |
) |
[inline, static, protected] |
calculates the inverse the argument (useful for Matrix::map)
| bool restore |
( |
FILE * |
f |
) |
[virtual] |
loads the controller values from a given file.
Implements Storeable.
| void step |
( |
const sensor * |
x_, |
|
|
int |
number_sensors, |
|
|
motor * |
y_, |
|
|
int |
number_motors | |
|
) |
| | [virtual] |
performs one step (includes learning).
Calulates motor commands from sensor inputs.
Implements AbstractController.
| void stepNoLearning |
( |
const sensor * |
x_, |
|
|
int |
number_sensors, |
|
|
motor * |
y_, |
|
|
int |
number_motors | |
|
) |
| | [virtual] |
performs one step without learning. Calulates motor commands from sensor inputs.
Implements AbstractController.
| bool store |
( |
FILE * |
f |
) |
const [virtual] |
stores the controller values to a given file.
Implements Storeable.
Member Data Documentation
const unsigned short buffersize = 10 [static, protected] |
The documentation for this class was generated from the following files: