22 #include <selforg/abstractcontroller.h>
23 #include <selforg/controller_misc.h>
28 #include <selforg/matrix.h>
29 #include <selforg/teachable.h>
30 #include <selforg/parametrizable.h>
66 virtual void init(
int sensornumber,
int motornumber,
RandGen* randGen = 0);
103 virtual bool store(FILE* f)
const;
122 virtual std::list<matrix::Matrix>
getParameters()
const override;
123 virtual int setParameters(
const std::list<matrix::Matrix>& params)
override;
173 virtual void learn();
176 static double g(
double z)
182 static double g_s(
double z)
189 static double clip(
double r,
double x){
virtual int getMotorNumber() const
returns the mumber of motors the controller was initialised with or 0 if not initialised ...
Definition: pimax.h:86
virtual int getSensorNumber() const
returns the number of sensors the controller was initialised with or 0 if not initialised ...
Definition: pimax.h:84
Matrix type.
Definition: matrix.h:65
matrix::Matrix ds0
Definition: pimax.h:139
matrix::Matrix L_buffer[buffersize]
Definition: pimax.h:147
paramval epsSigma
Definition: pimax.h:164
Interface for teachable controller.
Definition: teachable.h:32
bool someInternalParams
if true only some internal parameters are exported
Definition: pimax.h:45
PiMaxConf conf
configuration objects
Definition: pimax.h:151
virtual void motorBabblingStep(const sensor *, int number_sensors, const motor *, int number_motors)
called during babbling phase
Definition: pimax.cpp:197
Abstract class for robot controller (with some basic functionality).
Definition: abstractcontroller.h:46
virtual void setSensorTeaching(const matrix::Matrix &teaching)
The given sensor teaching signal (distal learning) is used for this timestep.
Definition: pimax.cpp:329
virtual void learn()
learn values model and controller (A,b,C,h)
Definition: pimax.cpp:232
matrix::Matrix b
Definition: pimax.h:134
bool useExtendedModel
if true, the extended model (S matrix) is used
Definition: pimax.h:36
matrix::Matrix C_native
Definition: pimax.h:140
double sensor
Definition: types.h:29
matrix::Matrix C
Definition: pimax.h:131
matrix::Matrix a_buffer[buffersize]
Definition: pimax.h:143
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
configuration object for PiMax controller. Use PiMax::getDefaultConf().
Definition: pimax.h:34
bool onlyMainParameters
if true only some configurable parameters are exported
Definition: pimax.h:46
static double g(double z)
neuron transfer function
Definition: pimax.h:176
bool intern_isTeaching
Definition: pimax.h:156
virtual bool restore(FILE *f)
loads the controller values from a given file.
Definition: pimax.cpp:379
static const unsigned short buffersize
Definition: pimax.h:128
virtual void step(const sensor *, int number_sensors, motor *, int number_motors)
performs one step (includes learning).
Definition: pimax.cpp:151
matrix::Matrix S
Definition: pimax.h:132
matrix::Matrix A
Definition: pimax.h:130
static double one_over(double x)
calculates the inverse the argument (useful for Matrix::map)
Definition: pimax.h:193
matrix::Matrix h
Definition: pimax.h:133
double paramval
Definition: configurable.h:88
bool useMetric
Definition: pimax.h:159
paramval damping
Definition: pimax.h:166
virtual void setC(const matrix::Matrix &C)
Definition: pimax.cpp:136
paramval epsA
Definition: pimax.h:163
int steps4Delay
of steps the motor values are delayed (1 means no delay)
Definition: pimax.h:44
double max(const matrix::Matrix &v)
returns the largest element
Definition: controller_misc.cpp:318
matrix::Matrix a_teaching
Definition: pimax.h:157
virtual ~PiMax()
Definition: pimax.cpp:72
virtual void stepNoLearning(const sensor *, int number_sensors, motor *, int number_motors)
performs one step without learning. Calulates motor commands from sensor inputs.
Definition: pimax.cpp:167
bool useTeaching
if true the controller can be taught see teachable interface
Definition: pimax.h:40
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: pimax.cpp:76
virtual void setA(const matrix::Matrix &A)
Definition: pimax.cpp:127
matrix::Matrix s_buffer[buffersize]
Definition: pimax.h:144
This controller implements the predictive information maximization described in paper: to be publishe...
Definition: pimax.h:61
virtual void setMotorTeaching(const matrix::Matrix &teaching)
The given motor teaching signal is used for this timestep.
Definition: pimax.cpp:320
matrix::Matrix gs_buffer[buffersize]
Definition: pimax.h:146
virtual matrix::Matrix getC()
Definition: pimax.cpp:132
paramval sense
Definition: pimax.h:161
unsigned short number_motors
Definition: pimax.h:127
static PiMaxConf getDefaultConf()
Definition: pimax.h:70
int paramint
Definition: configurable.h:98
matrix::Matrix xi_buffer[buffersize]
Definition: pimax.h:145
double motor
Definition: types.h:30
matrix::Matrix s_smooth
Definition: pimax.h:150
using ParameterList = std::list<matrix::Matrix>;
Definition: parametrizable.h:39
int t
Definition: pimax.h:153
PiMax(const PiMaxConf &conf=getDefaultConf())
Definition: pimax.cpp:24
virtual void seth(const matrix::Matrix &h)
Definition: pimax.cpp:145
paramval gamma
Definition: pimax.h:167
unsigned short number_sensors
Definition: pimax.h:126
paramval epsC
Definition: pimax.h:162
virtual matrix::Matrix geth()
Definition: pimax.cpp:141
bool useSigma
if true, the covariance matrix is learned otherwise a unit matrix is used
Definition: pimax.h:38
matrix::Matrix L
Definition: pimax.h:135
double min(const matrix::Matrix &v)
returns the smallest element
Definition: controller_misc.cpp:307
paramval factorH
Definition: pimax.h:165
matrix::Matrix A_native
Definition: pimax.h:141
paramint tau
Definition: pimax.h:169
static double g_s(double z)
derivative of g
Definition: pimax.h:182
virtual bool store(FILE *f) const
stores the controller values to a given file.
Definition: pimax.cpp:367
int steps4Averaging
of steps the sensors are averaged (1 means no averaging)
Definition: pimax.h:42
virtual int setParameters(const std::list< matrix::Matrix > ¶ms) override
sets the parameters.
Definition: pimax.cpp:349
virtual matrix::Matrix getLastSensorValues()
returns the last sensor values (useful for cross sensor coupling)
Definition: pimax.cpp:341
static double clip(double r, double x)
function that clips the second argument to the interval [-first,first]
Definition: pimax.h:189
virtual std::list< matrix::Matrix > getParameters() const override
Returns a list of matrices that parametrize the controller.
Definition: pimax.cpp:345
paramval causeaware
Definition: pimax.h:160
virtual matrix::Matrix getA()
Definition: pimax.cpp:123
matrix::Matrix Sigma
Definition: pimax.h:137
matrix::Matrix s
Definition: pimax.h:149
double initFeedbackStrength
initial strength of sensor to motor connection
Definition: pimax.h:35
virtual matrix::Matrix getLastMotorValues()
returns the last motor values (useful for cross motor coupling)
Definition: pimax.cpp:337