Дипломная работа: Исполняемое Win32 приложение
if (sigma==0)
fisError("Illegal parameters in fisGaussianMF() --> sigma = 0");
tmp = (x-c)/sigma;
return(exp(-tmp*tmp/2));
}
/* Extended Gaussian membership function */
double CFuzzy_::fisGaussian2Mf(double x, double *params)
{
double sigma1 = params[0], c1 = params[1];
double sigma2 = params[2], c2 = params[3];
double tmp1, tmp2;
if ((sigma1 == 0) || (sigma2 == 0))
fisError("Illegal parameters in fisGaussian2MF() --> sigma1 or sigma2 is zero");
tmp1 = x >= c1? 1:exp(-pow((x-c1)/sigma1, 2.0)/2);
tmp2 = x <= c2? 1:exp(-pow((x-c2)/sigma2, 2.0)/2);
return(tmp1*tmp2);
}
/* Sigmoidal membership function */
double CFuzzy_::fisSigmoidMf(double x, double *params)
{
double a = params[0], c = params[1];
return(1/(1+exp(-a*(x-c))));
}
void CFuzzy_::fisError(char *msg)
{
MessageBox(NULL,msg,"Error",MB_OK|MB_ICONSTOP);
}
// fuzzy.h : main header file for the FUZZY application CFuzzyApp
#include "resource.h"