continue.... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

continue....

bonnieclydebonnieclyde Posts: 13Member
continue from previous msg

void FillOutputVariables()
{
strcpy(OutputVariables[0].name,"Water Level");
OutputVariables[0].minimum=0.000000;
OutputVariables[0].maximum=30.000000;
OutputVariables[0].intervals=20;
OutputVariables[0].interval=1.500000;
OutputVariables[0].numberSets=3;
}

void FillInputs()
{
Inputs[0].minimum=0.000000;
Inputs[0].maximum=2.500000;
Inputs[1].minimum=1.250000;
Inputs[1].maximum=3.750000;
Inputs[2].minimum=2.500000;
Inputs[2].maximum=5.000000;
Inputs[3].minimum=0.000000;
Inputs[3].maximum=5.000000;
Inputs[4].minimum=2.500000;
Inputs[4].maximum=7.500000;
Inputs[5].minimum=5.000000;
Inputs[5].maximum=10.000000;
}

void FillDifusors()
{
Difusors[0].minimum=2.487500;
Difusors[0].maximum=2.512500;
Difusors[0].center=2.500000;
Difusors[0].points=1;
Difusors[0].interval=0.012500;
Difusors[0].var1=2.487500;
Difusors[0].var2=2.512500;
Difusors[0].var3=0.000000;
Difusors[0].var4=0.000000;
Difusors[1].minimum=4.975000;
Difusors[1].maximum=5.025000;
Difusors[1].center=5.000000;
Difusors[1].points=1;
Difusors[1].interval=0.025000;
Difusors[1].var1=4.975000;
Difusors[1].var2=5.025000;
Difusors[1].var3=0.000000;
Difusors[1].var4=0.000000;
}

void FillRules()
{
Rules[0][0]=0;Rules[0][1]=0;Rules[0][2]=0;
Rules[1][0]=0;Rules[1][1]=1;Rules[1][2]=0;
Rules[2][0]=0;Rules[2][1]=2;Rules[2][2]=1;
Rules[3][0]=1;Rules[3][1]=0;Rules[3][2]=0;
Rules[4][0]=1;Rules[4][1]=1;Rules[4][2]=1;
Rules[5][0]=1;Rules[5][1]=2;Rules[5][2]=2;
Rules[6][0]=2;Rules[6][1]=0;Rules[6][2]=1;
Rules[7][0]=2;Rules[7][1]=1;Rules[7][2]=2;
Rules[8][0]=2;Rules[8][1]=2;Rules[8][2]=2;
}

void FillModifiers()
{
Modifiers[0][0]=1.000000;Modifiers[0][1]=1.000000;
Modifiers[1][0]=1.000000;Modifiers[1][1]=1.000000;
Modifiers[2][0]=1.000000;Modifiers[2][1]=1.000000;
Modifiers[3][0]=1.000000;Modifiers[3][1]=1.000000;
Modifiers[4][0]=1.000000;Modifiers[4][1]=1.000000;
Modifiers[5][0]=1.000000;Modifiers[5][1]=1.000000;
Modifiers[6][0]=1.000000;Modifiers[6][1]=1.000000;
Modifiers[7][0]=1.000000;Modifiers[7][1]=1.000000;
Modifiers[8][0]=1.000000;Modifiers[8][1]=1.000000;
}

void FillCenterHeight()
{
CenterHeight[0][0]=3.750000;
CenterHeight[1][0]=3.750000;
CenterHeight[2][0]=15.000000;
CenterHeight[3][0]=3.750000;
CenterHeight[4][0]=15.000000;
CenterHeight[5][0]=26.250000;
CenterHeight[6][0]=15.000000;
CenterHeight[7][0]=26.250000;
CenterHeight[8][0]=26.250000;
}

float DifusorProperty(int numVar, float x)
{
float ux=0;
switch(numVar)
{
case 0:
if(x=Difusors[0].var1)
ux=1;
if(x>=Difusors[0].var2)
ux=0;
break;
case 1:
if(x=Difusors[1].var1)
ux=1;
if(x>=Difusors[1].var2)
ux=0;
break;
default:break;
}
return ux;
}

float InputVariableProperty(int numVar,int numConj, float x)
{
float ux=0;
switch(numVar)
{
case 0:
switch(numConj)
{
case 0:
if(x<(0.000000))
ux=1;
if(x<(1.250000)&&x>=(0.000000))
ux=1;
if(x<(2.500000)&&x>=(1.250000))
ux=((2.500000)-x)/((2.500000)-(1.250000));
if(x>=(2.500000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 1:
if(x<(1.250000))
ux=0;
if(x<(2.500000)&&x>=(1.250000))
ux=(x-(1.250000))/((2.500000)-(1.250000));
if(x<(3.750000)&&x>=(2.500000))
ux=((3.750000)-x)/((3.750000)-(2.500000));
if(x>=(3.750000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 2:
if(x<(2.500000))
ux=0;
if(x<(3.750000)&&x>=(2.500000))
ux=(x-(2.500000))/((3.750000)-(2.500000));
if(x>=(3.750000))
ux=1;
if(ux<0.0001)
ux=0;
break;
default:break;
}break;
case 1:
switch(numConj)
{
case 0:
if(x<(0.000000))
ux=1;
if(x<(2.500000)&&x>=(0.000000))
ux=1;
if(x<(5.000000)&&x>=(2.500000))
ux=((5.000000)-x)/((5.000000)-(2.500000));
if(x>=(5.000000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 1:
if(x<(2.500000))
ux=0;
if(x<(5.000000)&&x>=(2.500000))
ux=(x-(2.500000))/((5.000000)-(2.500000));
if(x<(7.500000)&&x>=(5.000000))
ux=((7.500000)-x)/((7.500000)-(5.000000));
if(x>=(7.500000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 2:
if(x<(5.000000))
ux=0;
if(x<(7.500000)&&x>=(5.000000))
ux=(x-(5.000000))/((7.500000)-(5.000000));
if(x>=(7.500000))
ux=1;
if(ux<0.0001)
ux=0;
break;
default:break;
}break;
default:break;
}
return ux;
}

float OutputVariableProperty(int numVar,int numConj, float x)
{
float ux=0;
switch(numVar)
{
case 0:
switch(numConj)
{
case 0:
if(x<(0.000000))
ux=1;
if(x<(7.500000)&&x>=(0.000000))
ux=1;
if(x<(15.000000)&&x>=(7.500000))
ux=((15.000000)-x)/((15.000000)-(7.500000));
if(x>=(15.000000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 1:
if(x<(7.500000))
ux=0;
if(x<(15.000000)&&x>=(7.500000))
ux=(x-(7.500000))/((15.000000)-(7.500000));
if(x<(22.500000)&&x>=(15.000000))
ux=((22.500000)-x)/((22.500000)-(15.000000));
if(x>=(22.500000))
ux=0;
if(ux<0.0001)
ux=0;
break;
case 2:
if(x<(15.000000))
ux=0;
if(x<(22.500000)&&x>=(15.000000))
ux=(x-(15.000000))/((22.500000)-(15.000000));
if(x>=(22.500000))
ux=1;
if(ux<0.0001)
ux=0;
break;
default:break;
}break;
default:break;
}
return ux;
}

float Implication(float x,float y)
{
float rel;
if(x<y)
{
rel=x;
}else
{
rel=y;
}
return rel;
}

float Composition(float x,float y)
{
float z;
if(x<y)
{
z=x;
}else
{
z=y;
}
return z;
}

float Conjunction(float x,float y)
{
float z;
if(x>y)
{
z=x;
}else
{
z=y;
}
return z;
}

float And(float x,float y)
{
float z;
if(x<y)
{
z=x;
}else
{
z=y;
}
return z;
}


Sign In or Register to comment.