https://github.com/kalmik/fuzzy-mpi
Implementation of fuzzy logic for distributed memory. (MPI Based).
https://github.com/kalmik/fuzzy-mpi
Last synced: 8 months ago
JSON representation
Implementation of fuzzy logic for distributed memory. (MPI Based).
- Host: GitHub
- URL: https://github.com/kalmik/fuzzy-mpi
- Owner: kalmik
- Created: 2015-11-05T23:09:23.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-27T17:53:48.000Z (about 10 years ago)
- Last Synced: 2025-02-10T14:11:21.584Z (10 months ago)
- Language: C
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fuzzy-mpi
Implementation of fuzzy logic for distributed memory. (MPI Based).
##How to use
###instaling MPI
```
sudo apt-get isntall openmpi1.5-bin openmpi1.5-doc libopenmpi1.5-dev
```
### buiding
```
mpicc fuzzy.c fuzzy-loader.c fuzzy-core.c -o fuzzy
```
#### options
-DGENERATE_DATA -- random inputs
-DDEBUG -- debug mode
### runing
```
mpiexec -n ./fuzzy study-cases/testes.fis
```
###fuzzy-loader API
Configure your fuzzy system based on .fis file from MATLAB®
```C
//Jumping pointer line in file
void next_line(
FILE* fp //(in) file pointer
);
//packing input and output structure from file
float* pack_io(
FILE* fp, //(in) file pointer
int* sz //(out) structure size
);
float* load_input(
FILE* fp, //(in) file pointer
int* sz //(out) structure size
);
float* load_output(
FILE* fp, //(in) file pointer
int* sz //(out) structure size
);
//loag rule structure from file
int* load_rules(
FILE *fp, //(in) file pointer
int numInputs, //(in) number of inputs
int numOutputs, //(in) number of outputs
int numRules, //(in) number of rules
int *total //(out) total data read
);
//return number of inputs
int get_numInputs(FILE* fp);
//return number of outputs
int get_numOutputs(FILE* fp);
//return number of rules
int get_numRules(FILE* fp);
```
### fuzzy-core API
Utils function to computing fuzzy data
```C
float max(float _a, float _b);
float min(float _a, float _b);
float orOp(float _a, float _b);
float andOp(float _a, float _b);
float trimf(float _value, float _points[]);
float trapmf(float _value, float _points[]);
float fuzzify(float _value, float* _points, int size);
void defuzzify( double _value, float* _rules, int _size, double* uX, double* u);
```