A fuzzy logic C++ library
Defines | Functions
test_learning_1.cpp File Reference

Generates dummy random data, just for testing the "learning" code. More...

#include "app_common.hpp"
#include "slifis.hpp"
+ Include dependency graph for test_learning_1.cpp:

Defines

#define DEF_NB_INPUTS   3
 default nb of inputs of FIS
#define DEF_NB_POINTS   400
 default nb of data points generated
#define DEF_MIN_NBMF   3
 default minimum nb of membership functions in set
#define DEF_MAX_NBMF   6
 default maximum nb of membership functions in set
#define RAND_FLOAT(min, max)   ( 1.0*rand()/RAND_MAX*((max)-(min))+(min) )
 a macro that computes a pseudo-random floating-point value lying in the range [min,max]
#define RAND_INT(min, max)   ( rand()%((max)-(min))+(min) )
 a macro that computes a pseudo-random integer value lying in the range [min,max]
#define STDERR_FILE_NAME   "stderr_test_learning_1.txt"

Functions

int main (int argc, char **argv)
 See test_learning_1.cpp.

Detailed Description

Generates dummy random data, just for testing the "learning" code.

Arguments:

  1. nb of inputs (default is DEF_NB_INPUTS)
  2. nb of points (default is DEF_NB_POINTS)

This app:

  1. creates a FIS
  2. generates some synthetic data
  3. generates FIS rules using the synthetic data
  4. reduces the rule base
  5. saves the rule base into two files: "rulebase_nosort.csv" and "rulebase_sort.csv"

Define Documentation

#define DEF_NB_INPUTS   3

default nb of inputs of FIS

Referenced by main().

#define DEF_NB_POINTS   400

default nb of data points generated

Referenced by main().

#define DEF_MIN_NBMF   3

default minimum nb of membership functions in set

Referenced by main().

#define DEF_MAX_NBMF   6

default maximum nb of membership functions in set

Referenced by main().

#define RAND_FLOAT (   min,
  max 
)    ( 1.0*rand()/RAND_MAX*((max)-(min))+(min) )

a macro that computes a pseudo-random floating-point value lying in the range [min,max]

Referenced by main().

#define RAND_INT (   min,
  max 
)    ( rand()%((max)-(min))+(min) )

a macro that computes a pseudo-random integer value lying in the range [min,max]

Referenced by main().

#define STDERR_FILE_NAME   "stderr_test_learning_1.txt"

Referenced by main().


Function Documentation

int main ( int  argc,
char **  argv 
)