22 #include <selforg/abstractcontroller.h>
23 #include <selforg/controller_misc.h>
28 #include <selforg/matrix.h>
38 virtual void init(
int sensornumber,
int motornumber,
RandGen* randGen = 0);
59 virtual bool store(FILE* f)
const;
100 virtual void learn();
103 static double g(
double z)
109 static double g_s(
double z)
116 static double clip(
double r,
double x){
matrix::Matrix x_buffer[buffersize]
Definition: sos.h:82
Matrix type.
Definition: matrix.h:65
matrix::Matrix y_buffer[buffersize]
Definition: sos.h:81
virtual matrix::Matrix geth()
Definition: sos.cpp:93
int t
Definition: sos.h:86
double init_feedback_strength
Definition: sos.h:90
Abstract class for robot controller (with some basic functionality).
Definition: abstractcontroller.h:46
unsigned short number_motors
Definition: sos.h:73
static double clip(double r, double x)
function that clips the second argument to the interval [-first,first]
Definition: sos.h:116
bool loga
Definition: sos.h:88
virtual void step(const sensor *, int number_sensors, motor *, int number_motors)
performs one step (includes learning).
Definition: sos.cpp:103
matrix::Matrix C
Definition: sos.h:77
double sensor
Definition: types.h:29
matrix::Matrix x
Definition: sos.h:84
static double g(double z)
neuron transfer function
Definition: sos.h:103
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
Sos(double init_feedback_strength=1.0)
Definition: sos.cpp:24
bool TLE
Definition: sos.h:87
virtual void setC(const matrix::Matrix &C)
Definition: sos.cpp:88
matrix::Matrix v_avg
Definition: sos.h:83
unsigned short number_sensors
Definition: sos.h:72
virtual matrix::Matrix getA()
Definition: sos.cpp:75
virtual void learn()
learn values model and controller (A,b,C,h)
Definition: sos.cpp:149
virtual ~Sos()
Definition: sos.cpp:46
double paramval
Definition: configurable.h:88
This controller implements the standard algorihm described the Chapter 5 (Homeokinesis) of book "The ...
Definition: sos.h:34
double max(const matrix::Matrix &v)
returns the largest element
Definition: controller_misc.cpp:318
virtual void stepNoLearning(const sensor *, int number_sensors, motor *, int number_motors)
performs one step without learning. Calulates motor commands from sensor inputs.
Definition: sos.cpp:118
matrix::Matrix L
Definition: sos.h:80
static double g_s(double z)
derivative of g
Definition: sos.h:109
paramint s4delay
Definition: sos.h:96
virtual void init(int sensornumber, int motornumber, RandGen *randGen=0)
initialisation of the controller with the given sensor/ motornumber Must be called before use...
Definition: sos.cpp:50
paramval epsA
Definition: sos.h:94
matrix::Matrix b
Definition: sos.h:79
static const unsigned short buffersize
Definition: sos.h:74
virtual void setA(const matrix::Matrix &A)
Definition: sos.cpp:79
int paramint
Definition: configurable.h:98
double motor
Definition: types.h:30
paramval epsC
Definition: sos.h:93
virtual matrix::Matrix getC()
Definition: sos.cpp:84
matrix::Matrix A
Definition: sos.h:76
virtual int getMotorNumber() const
returns the mumber of motors the controller was initialised with or 0 if not initialised ...
Definition: sos.h:45
virtual int getSensorNumber() const
returns the number of sensors the controller was initialised with or 0 if not initialised ...
Definition: sos.h:43
static double one_over(double x)
calculates the inverse the argument (useful for Matrix::map)
Definition: sos.h:120
virtual void seth(const matrix::Matrix &h)
Definition: sos.cpp:97
double min(const matrix::Matrix &v)
returns the smallest element
Definition: controller_misc.cpp:307
virtual bool restore(FILE *f)
loads the controller values from a given file.
Definition: sos.cpp:211
matrix::Matrix h
Definition: sos.h:78
paramint s4avg
Definition: sos.h:95
matrix::Matrix x_smooth
Definition: sos.h:85
paramval creativity
Definition: sos.h:92
virtual bool store(FILE *f) const
stores the controller values to a given file.
Definition: sos.cpp:200