00001 /* 00002 * Copyright (c) 2007. The BATI team. All right reserved. 00003 * 00004 * This file is part of BATI library. 00005 * 00006 * BATI library is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * BATI library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with BATI library. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 /* ************************* fusion_floue.h **********************************/ 00020 /* */ 00021 /* descripteurs et prototypes associes a l'operateur fusion_floue */ 00022 /* */ 00023 /* Derniere modif : Lionel VALET, 19/11/99 */ 00024 /* ****************************************************************************/ 00025 00026 /* pas de code avant cette ligne*/ 00027 #ifndef __ff_symb2 00028 #define __ff_symb2 00029 00030 00031 #define gr_MAXI_t(i,j) ( (i) > (j) ? (i) : (j) ) 00032 #define gr_MINI_t(i,j) ( (i) < (j) ? (i) : (j) ) 00033 #define gr_SQR_t(i) ( (i) * (i) ) 00034 00035 00036 typedef int (*gr_PFI_t)(); //pointer to function that returns int 00037 00038 typedef char gr_chaine_t[100]; 00039 typedef unsigned char gr_byte_t; 00040 00060 typedef struct 00061 { 00062 gr_chaine_t nom; 00063 int type; 00064 float gauche; 00065 float mode; 00066 float droite; 00067 } gr_symbol_t; 00068 00069 typedef struct 00070 { 00071 unsigned char * liste_in; 00072 unsigned char nom_out; 00073 float ponderation; 00074 }gr_uneRegle_t; 00075 00076 typedef struct 00077 { 00078 int nb_regle; 00079 gr_uneRegle_t * regle; 00080 }gr_lesRegles_t; 00081 00082 typedef struct 00083 { 00084 gr_chaine_t nom; 00085 unsigned char nb_fct; 00086 gr_symbol_t *part; 00087 }gr_partition_t; 00088 00089 typedef float gr_degreApp_t; 00090 typedef gr_degreApp_t *gr_ssEnsFlouSymb_t; 00091 00092 typedef struct 00093 { 00094 int nb_descripteur; 00095 gr_ssEnsFlouSymb_t * descript; 00096 }gr_descripteur_t; 00097 00098 typedef struct 00099 { 00100 unsigned char nb_entree; 00101 gr_partition_t *partition; 00102 }gr_fctAppartenance_t; 00103 00106 typedef struct { 00107 int oper[3]; 00108 gr_PFI_t op[3]; //pointeur a la fonction de calcul des operateurs 00109 int defuzz; 00110 gr_fctAppartenance_t fonction; 00111 gr_lesRegles_t rgl; 00112 gr_descripteur_t des; 00113 char *nom; 00114 } gr_fusionFloue_t; 00115 00116 param *grClassif_lect(gr_fusionFloue_t *des, param *ptp, char *debq); 00117 int grClassif_init(gr_fusionFloue_t *des); 00118 int grClassif_calc(gr_fusionFloue_t *des, float *data, float *result); 00119 int grClassif_ferm(gr_fusionFloue_t *des); 00120 00121 00122 /*pas de code après cette ligne */ 00123 #endif