home Forums # Technical Support jfuzzylite with two input values Reply To: jfuzzylite with two input values

#1660
Unknown
Member

Hi,

I’m very sorry to bother you. But your suggestion made me very close to the correct value.

InputVariable inputVariable1 = new InputVariable();
inputVariable1.setEnabled(true);
inputVariable1.setName("Criticallity");
inputVariable1.setRange(0.000, 5.000);
inputVariable1.addTerm(new Triangle("Low", 0.000, 1.000, 2.000));
inputVariable1.addTerm(new Triangle("Average", 1.000, 2.000, 3.000));
inputVariable1.addTerm(new Triangle("High", 2.000, 3.000, 4.000));
inputVariable1.addTerm(new Triangle("Very_High", 3.000, 4.000, 5.000));
engine.addInputVariable(inputVariable1);

InputVariable inputVariable2 = new InputVariable();
inputVariable2.setEnabled(true);
inputVariable2.setName("Availability");
inputVariable2.setRange(85.000, 100.000);
inputVariable2.addTerm(new Ramp("Limit", 95.000, 90.000));  
inputVariable2.addTerm(new Triangle("Very_Low", 90.000, 95.000, 98.000));
inputVariable2.addTerm(new Triangle("Low", 95.000, 98.000, 99.000));
inputVariable2.addTerm(new Triangle("Average", 98.000, 99.000, 99.900));
inputVariable2.addTerm(new Triangle("High", 99.000, 99.900, 100.000));
inputVariable2.addTerm(new Ramp("Perfect", 99.900, 100.000));  
engine.addInputVariable(inputVariable2);

With this code, I enter 3.8 and 100 –> iDisp.CalcIndDisp(3.8, 100);
and I get 9.999999999999995, but the result should be: 9.74 What other changes should I do?

IndDisp Block
indicator block Availability (IndDisp)

Sorry again and thanks for help!