22 #include <selforg/homeokinbase.h>
23 #include <selforg/matrix.h>
24 #include <selforg/teachable.h>
25 #include <selforg/noisegenerator.h>
26 #include <selforg/randomgenerator.h>
27 #include <selforg/parametrizable.h>
77 virtual void init(
int sensornumber,
int motornumber,
RandGen* randGen = 0);
96 virtual bool store(FILE* f)
const;
125 virtual std::list<matrix::Matrix>
getParameters()
const override;
126 virtual int setParameters(
const std::list<matrix::Matrix>& params)
override;
178 virtual void calcXsi(
int delay);
Matrix type.
Definition: matrix.h:65
matrix::Matrix initialC
initialC initial controller matrix (if null matrix then automatic, see cInit)
Definition: semox.h:32
bool modelExt
modelExt if true then additional matrix S is used in forward model (sees sensors) ...
Definition: semox.h:37
paramval dampController
damping of C matrix
Definition: semox.h:160
bool parambool
Definition: configurable.h:93
Interface for teachable controller.
Definition: teachable.h:32
unsigned short number_motors
Definition: semox.h:130
matrix::Matrix B
Model Bias.
Definition: semox.h:136
virtual void stepNoLearning(const sensor *, int number_sensors, motor *, int number_motors)
performs one step without learning. Calulates motor commands from sensor inputs.
Definition: semox.cpp:143
virtual void step(const sensor *, int number_sensors, motor *, int number_motors)
performs one step (includes learning).
Definition: semox.cpp:126
double sInit
sInit initial size of the diagonals of the S matrix
Definition: semox.h:36
double xsi_norm
norm of matrix
Definition: semox.h:145
int managementInterval
interval between subsequent management function calls
Definition: semox.h:167
Abstract class (interface) for robot controller that use are based on the homeokinetic prinziple...
Definition: homeokinbase.h:36
double sensor
Definition: types.h:29
parambool _modelExt_copy
copy of modelExtension variable (to achieve readonly)
Definition: semox.h:168
double aInit
aInit initial size of the diagonals of the A matrix
Definition: semox.h:35
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
SeMoX(const SeMoXConf &conf=getDefaultConf())
Definition: semox.cpp:25
virtual int getSensorNumber() const
returns the number of sensors the controller was initialised with or 0 if not initialised ...
Definition: semox.h:82
virtual void calcXsi(int delay)
calculates xsi for the current time step using the delayed y values
Definition: semox.cpp:181
virtual int setParameters(const std::list< matrix::Matrix > ¶ms) override
sets the parameters.
Definition: semox.cpp:333
virtual std::list< matrix::Matrix > getParameters() const override
Returns a list of matrices that parametrize the controller.
Definition: semox.cpp:329
double cNonDiag
cNonDiag initial size of the non-diagonal elements of the C matrix (if C is not given) ...
Definition: semox.h:34
SeMoXConf conf
Definition: semox.h:162
int buffersize
buffersize size of the time-buffer for x,y,eta
Definition: semox.h:31
matrix::Matrix H
Controller Bias.
Definition: semox.h:135
static SeMoXConf getDefaultConf()
returns the default configuration
Definition: semox.h:63
paramval modelNoise
strength of noisy bias
Definition: semox.h:143
int t_rand
initial random time to avoid syncronous management of all controllers
Definition: semox.h:166
double cInit
cInit initial size of the diagonals of the C matrix (if C is not given)
Definition: semox.h:33
This controller follows the prinziple of homeokinesis and implements the extensions described in the ...
Definition: semox.h:57
matrix::Matrix * x_buffer
Definition: semox.h:149
matrix::Matrix S
additional Model Matrix (sensors derivatives to sensors)
Definition: semox.h:133
matrix::Matrix xsi
current output error
Definition: semox.h:140
virtual matrix::Matrix getLastMotorValues()
returns the last motor values (useful for cross motor coupling)
Definition: semox.cpp:408
paramval gamma_cont
parameter to include contiuity in motor values (avoid high frequencies)
Definition: semox.h:155
double sensor
Definition: abstractcontroller.h:48
matrix::Matrix y_teaching
motor teaching signal
Definition: semox.h:153
double paramval
Definition: configurable.h:88
bool intern_useTeaching
flag whether there is an actual teachning signal or not
Definition: semox.h:165
virtual bool store(FILE *f) const
stores the controller values to a given file.
Definition: semox.cpp:350
virtual int getMotorNumber() const
returns the mumber of motors the controller was initialised with or 0 if not initialised ...
Definition: semox.h:84
virtual void setMotorTeaching(const matrix::Matrix &teaching)
The given motor teaching signal is used for this timestep.
Definition: semox.cpp:392
NoiseGenerator * BNoiseGen
Noisegenerator for noisy bias.
Definition: semox.h:142
matrix::Matrix SmallID
small identity matrix in the dimension of R
Definition: semox.h:138
virtual void setSensorTeaching(const matrix::Matrix &teaching)
The given sensor teaching signal (distal learning) is used for this timestep.
Definition: semox.cpp:401
matrix::Matrix * y_buffer
Definition: semox.h:151
virtual matrix::Matrix calculateControllerValues(const matrix::Matrix &x_smooth)
returns controller output for given sensor values
Definition: semox.cpp:313
paramval dampModel
damping of A and S matrices
Definition: semox.h:159
virtual matrix::Matrix getLastSensorValues()
returns the last sensor values (useful for cross sensor coupling)
Definition: semox.cpp:412
virtual void fillBuffersAndControl(const sensor *x_, int number_sensors, motor *y_, int number_motors)
puts the sensors in the ringbuffer, generate controller values and put them in the ...
Definition: semox.cpp:151
matrix::Matrix v
shift
Definition: semox.h:139
matrix::Matrix A
Model Matrix (motors to sensors)
Definition: semox.h:132
paramval discountS
discount strength for hierachical model
Definition: semox.h:157
virtual void management()
handles inhibition damping etc.
Definition: semox.cpp:318
double motor
Definition: types.h:30
paramval gamma_teach
strength of teaching
Definition: semox.h:156
matrix::Matrix C
Controller Matrix.
Definition: semox.h:134
matrix::Matrix * x_c_buffer
buffer for sensors with context sensors
Definition: semox.h:150
matrix::Matrix R
C*A.
Definition: semox.h:137
virtual ~SeMoX()
Definition: semox.cpp:60
using ParameterList = std::list<matrix::Matrix>;
Definition: parametrizable.h:39
int numContext
number of context sensors (considered at the end of the sensor vector, which are only feed to the mod...
Definition: semox.h:40
virtual bool restore(FILE *f)
loads the controller values from a given file.
Definition: semox.cpp:361
Just create your own simulation, it's up to you.
Definition: ode_robots/examples/basic/main.cpp:46
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: semox.cpp:69
virtual std::list< ILayer > getStructuralLayers() const
Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering...
Definition: semox.cpp:373
bool someInternalParams
someInternalParams if true only some internal parameters are exported
Definition: semox.h:41
virtual void learnController()
learn H,C with motors y and corresponding sensors x
Definition: semox.cpp:203
double motor
Definition: abstractcontroller.h:49
virtual std::list< IConnection > getStructuralConnections() const
Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The...
Definition: semox.cpp:381
static double regularizedInverse(double v)
virtual void learnModel(int delay)
learn A, (and S) using motors y and corresponding sensors x
Definition: semox.cpp:279
int c
Definition: hexapod.cpp:56
virtual matrix::Matrix model(const matrix::Matrix *x_buffer, int delay, const matrix::Matrix &y)
calculates the predicted sensor values
Definition: semox.cpp:193
double pain
if the modelling error (xsi) is too high we have a pain signal
Definition: semox.h:147
struct SeMoXConf SeMoXConf
unsigned short number_sensors
Definition: semox.h:129
Interface and basic class for noise generator.
Definition: noisegenerator.h:37
double xsi_norm_avg
average norm of xsi (used to define whether Modell learns)
Definition: semox.h:146