Exemplo n.º 1
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("anfis");

InputVariable* inputVariable1 = new InputVariable;
inputVariable1->setEnabled(true);
inputVariable1->setName("in_n1");
inputVariable1->setRange(1.000, 31.000);
inputVariable1->addTerm(new Bell("in1mf1", 2.253, 16.220, 5.050));
inputVariable1->addTerm(new Bell("in1mf2", 31.260, 15.021, 1.843));
engine->addInputVariable(inputVariable1);

InputVariable* inputVariable2 = new InputVariable;
inputVariable2->setEnabled(true);
inputVariable2->setName("in_n2");
inputVariable2->setRange(1.000, 31.000);
inputVariable2->addTerm(new Bell("in2mf1", 0.740, 15.021, 1.843));
inputVariable2->addTerm(new Bell("in2mf2", 29.747, 16.220, 5.050));
engine->addInputVariable(inputVariable2);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("out1");
outputVariable->setRange(-0.334, 1.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(Linear::create("out1mf1", engine, 0.026, 0.071, -0.615));
outputVariable->addTerm(Linear::create("out1mf2", engine, -0.036, 0.036, -1.169));
outputVariable->addTerm(Linear::create("out1mf3", engine, -0.094, 0.094, 2.231));
outputVariable->addTerm(Linear::create("out1mf4", engine, -0.071, -0.026, 2.479));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(new AlgebraicProduct);
ruleBlock->setDisjunction(fl::null);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if in_n1 is in1mf1 and in_n2 is in2mf1 then out1 is out1mf1", engine));
ruleBlock->addRule(fl::Rule::parse("if in_n1 is in1mf1 and in_n2 is in2mf2 then out1 is out1mf2", engine));
ruleBlock->addRule(fl::Rule::parse("if in_n1 is in1mf2 and in_n2 is in2mf1 then out1 is out1mf3", engine));
ruleBlock->addRule(fl::Rule::parse("if in_n1 is in1mf2 and in_n2 is in2mf2 then out1 is out1mf4", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 2
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("sugeno tipper");

InputVariable* inputVariable1 = new InputVariable;
inputVariable1->setEnabled(true);
inputVariable1->setName("service");
inputVariable1->setRange(0.000, 10.000);
inputVariable1->addTerm(new Gaussian("poor", 0.000, 1.500));
inputVariable1->addTerm(new Gaussian("average", 5.000, 1.500));
inputVariable1->addTerm(new Gaussian("good", 10.000, 1.500));
engine->addInputVariable(inputVariable1);

InputVariable* inputVariable2 = new InputVariable;
inputVariable2->setEnabled(true);
inputVariable2->setName("food");
inputVariable2->setRange(0.000, 10.000);
inputVariable2->addTerm(new Trapezoid("rancid", -5.000, 0.000, 1.000, 3.000));
inputVariable2->addTerm(new Trapezoid("delicious", 7.000, 9.000, 10.000, 15.000));
engine->addInputVariable(inputVariable2);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("tip");
outputVariable->setRange(-30.000, 30.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(Linear::create("cheap", engine, 0.000, 0.000, 5.000));
outputVariable->addTerm(Linear::create("average", engine, 0.000, 0.000, 15.000));
outputVariable->addTerm(Linear::create("generous", engine, 0.000, 0.000, 25.000));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(fl::null);
ruleBlock->setDisjunction(new Maximum);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if service is poor or food is rancid then tip is cheap", engine));
ruleBlock->addRule(fl::Rule::parse("if service is average then tip is average", engine));
ruleBlock->addRule(fl::Rule::parse("if service is good or food is delicious then tip is generous", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 3
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("simple-dimmer");

InputVariable* inputVariable = new InputVariable;
inputVariable->setEnabled(true);
inputVariable->setName("Ambient");
inputVariable->setRange(0.000, 1.000);
inputVariable->addTerm(new Triangle("DARK", 0.000, 0.250, 0.500));
inputVariable->addTerm(new Triangle("MEDIUM", 0.250, 0.500, 0.750));
inputVariable->addTerm(new Triangle("BRIGHT", 0.500, 0.750, 1.000));
engine->addInputVariable(inputVariable);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("Power");
outputVariable->setRange(0.000, 1.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(new Constant("LOW", 0.250));
outputVariable->addTerm(new Constant("MEDIUM", 0.500));
outputVariable->addTerm(new Constant("HIGH", 0.750));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(fl::null);
ruleBlock->setDisjunction(fl::null);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if Ambient is DARK then Power is HIGH", engine));
ruleBlock->addRule(fl::Rule::parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
ruleBlock->addRule(fl::Rule::parse("if Ambient is BRIGHT then Power is LOW", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 4
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("Heart-Disease-Risk");

InputVariable* inputVariable1 = new InputVariable;
inputVariable1->setEnabled(true);
inputVariable1->setName("LDLLevel");
inputVariable1->setRange(0.000, 300.000);
inputVariable1->addTerm(new Trapezoid("Low", -1.000, 0.000, 90.000, 110.000));
inputVariable1->addTerm(new Trapezoid("LowBorderline", 90.000, 110.000, 120.000, 140.000));
inputVariable1->addTerm(new Trapezoid("Borderline", 120.000, 140.000, 150.000, 170.000));
inputVariable1->addTerm(new Trapezoid("HighBorderline", 150.000, 170.000, 180.000, 200.000));
inputVariable1->addTerm(new Trapezoid("High", 180.000, 200.000, 300.000, 301.000));
engine->addInputVariable(inputVariable1);

InputVariable* inputVariable2 = new InputVariable;
inputVariable2->setEnabled(true);
inputVariable2->setName("HDLLevel");
inputVariable2->setRange(0.000, 100.000);
inputVariable2->addTerm(new Trapezoid("LowHDL", -1.000, 0.000, 35.000, 45.000));
inputVariable2->addTerm(new Trapezoid("ModerateHDL", 35.000, 45.000, 55.000, 65.000));
inputVariable2->addTerm(new Trapezoid("HighHDL", 55.000, 65.000, 100.000, 101.000));
engine->addInputVariable(inputVariable2);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("HeartDiseaseRisk");
outputVariable->setRange(0.000, 10.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(new Constant("NoRisk", 0.000));
outputVariable->addTerm(new Constant("LowRisk", 2.500));
outputVariable->addTerm(new Constant("MediumRisk", 5.000));
outputVariable->addTerm(new Constant("HighRisk", 7.500));
outputVariable->addTerm(new Constant("ExtremeRisk", 10.000));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(new Minimum);
ruleBlock->setDisjunction(fl::null);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Low and HDLLevel is LowHDL then HeartDiseaseRisk is MediumRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Low and HDLLevel is ModerateHDL then HeartDiseaseRisk is LowRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Low and HDLLevel is HighHDL then HeartDiseaseRisk is NoRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is LowBorderline and HDLLevel is LowHDL then HeartDiseaseRisk is MediumRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is LowBorderline and HDLLevel is ModerateHDL then HeartDiseaseRisk is LowRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is LowBorderline and HDLLevel is HighHDL then HeartDiseaseRisk is LowRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Borderline and HDLLevel is LowHDL then HeartDiseaseRisk is HighRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Borderline and HDLLevel is ModerateHDL then HeartDiseaseRisk is MediumRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is Borderline and HDLLevel is HighHDL then HeartDiseaseRisk is LowRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is HighBorderline and HDLLevel is LowHDL then HeartDiseaseRisk is HighRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is HighBorderline and HDLLevel is ModerateHDL then HeartDiseaseRisk is HighRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is HighBorderline and HDLLevel is HighHDL then HeartDiseaseRisk is MediumRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is High and HDLLevel is LowHDL then HeartDiseaseRisk is ExtremeRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is High and HDLLevel is ModerateHDL then HeartDiseaseRisk is HighRisk", engine));
ruleBlock->addRule(fl::Rule::parse("if LDLLevel is High and HDLLevel is HighHDL then HeartDiseaseRisk is MediumRisk", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 5
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("slcp1");

InputVariable* inputVariable1 = new InputVariable;
inputVariable1->setEnabled(true);
inputVariable1->setName("in1");
inputVariable1->setRange(-0.300, 0.300);
engine->addInputVariable(inputVariable1);

InputVariable* inputVariable2 = new InputVariable;
inputVariable2->setEnabled(true);
inputVariable2->setName("in2");
inputVariable2->setRange(-1.000, 1.000);
engine->addInputVariable(inputVariable2);

InputVariable* inputVariable3 = new InputVariable;
inputVariable3->setEnabled(true);
inputVariable3->setName("in3");
inputVariable3->setRange(-3.000, 3.000);
engine->addInputVariable(inputVariable3);

InputVariable* inputVariable4 = new InputVariable;
inputVariable4->setEnabled(true);
inputVariable4->setName("in4");
inputVariable4->setRange(-3.000, 3.000);
engine->addInputVariable(inputVariable4);

InputVariable* inputVariable5 = new InputVariable;
inputVariable5->setEnabled(true);
inputVariable5->setName("in5");
inputVariable5->setRange(0.500, 1.500);
inputVariable5->addTerm(new Gaussian("small", 0.500, 0.200));
inputVariable5->addTerm(new Gaussian("medium", 1.000, 0.200));
inputVariable5->addTerm(new Gaussian("large", 1.500, 0.200));
engine->addInputVariable(inputVariable5);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("out");
outputVariable->setRange(-10.000, 10.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(Linear::create("outmf1", engine, 32.166, 5.835, 3.162, 3.757, 0.000, 0.000));
outputVariable->addTerm(Linear::create("outmf2", engine, 39.012, 9.947, 3.162, 4.269, 0.000, 0.000));
outputVariable->addTerm(Linear::create("outmf3", engine, 45.009, 13.985, 3.162, 4.666, 0.000, 0.000));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(fl::null);
ruleBlock->setDisjunction(fl::null);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if in5 is small then out is outmf1", engine));
ruleBlock->addRule(fl::Rule::parse("if in5 is medium then out is outmf2", engine));
ruleBlock->addRule(fl::Rule::parse("if in5 is large then out is outmf3", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 6
0
int main(int argc, char** argv){
using namespace fl;

Engine* engine = new Engine;
engine->setName("slcp");

InputVariable* inputVariable1 = new InputVariable;
inputVariable1->setEnabled(true);
inputVariable1->setName("in1");
inputVariable1->setRange(-0.300, 0.300);
inputVariable1->addTerm(new Bell("in1mf1", -0.300, 0.300, 2.000));
inputVariable1->addTerm(new Bell("in1mf2", 0.300, 0.300, 2.000));
engine->addInputVariable(inputVariable1);

InputVariable* inputVariable2 = new InputVariable;
inputVariable2->setEnabled(true);
inputVariable2->setName("in2");
inputVariable2->setRange(-1.000, 1.000);
inputVariable2->addTerm(new Bell("in2mf1", -1.000, 1.000, 2.000));
inputVariable2->addTerm(new Bell("in2mf2", 1.000, 1.000, 2.000));
engine->addInputVariable(inputVariable2);

InputVariable* inputVariable3 = new InputVariable;
inputVariable3->setEnabled(true);
inputVariable3->setName("in3");
inputVariable3->setRange(-3.000, 3.000);
inputVariable3->addTerm(new Bell("in3mf1", -3.000, 3.000, 2.000));
inputVariable3->addTerm(new Bell("in3mf2", 3.000, 3.000, 2.000));
engine->addInputVariable(inputVariable3);

InputVariable* inputVariable4 = new InputVariable;
inputVariable4->setEnabled(true);
inputVariable4->setName("in4");
inputVariable4->setRange(-3.000, 3.000);
inputVariable4->addTerm(new Bell("in4mf1", -3.000, 3.000, 2.000));
inputVariable4->addTerm(new Bell("in4mf2", 3.000, 3.000, 2.000));
engine->addInputVariable(inputVariable4);

OutputVariable* outputVariable = new OutputVariable;
outputVariable->setEnabled(true);
outputVariable->setName("out");
outputVariable->setRange(-10.000, 10.000);
outputVariable->fuzzyOutput()->setAccumulation(fl::null);
outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
outputVariable->setDefaultValue(fl::nan);
outputVariable->setLockPreviousOutputValue(false);
outputVariable->setLockOutputValueInRange(false);
outputVariable->addTerm(Linear::create("outmf1", engine, 41.373, 10.030, 3.162, 4.288, 0.339));
outputVariable->addTerm(Linear::create("outmf2", engine, 40.409, 10.053, 3.162, 4.288, 0.207));
outputVariable->addTerm(Linear::create("outmf3", engine, 41.373, 10.030, 3.162, 4.288, 0.339));
outputVariable->addTerm(Linear::create("outmf4", engine, 40.409, 10.053, 3.162, 4.288, 0.207));
outputVariable->addTerm(Linear::create("outmf5", engine, 38.561, 10.177, 3.162, 4.288, -0.049));
outputVariable->addTerm(Linear::create("outmf6", engine, 37.596, 10.154, 3.162, 4.288, -0.181));
outputVariable->addTerm(Linear::create("outmf7", engine, 38.561, 10.177, 3.162, 4.288, -0.049));
outputVariable->addTerm(Linear::create("outmf8", engine, 37.596, 10.154, 3.162, 4.288, -0.181));
outputVariable->addTerm(Linear::create("outmf9", engine, 37.596, 10.154, 3.162, 4.288, 0.181));
outputVariable->addTerm(Linear::create("outmf10", engine, 38.561, 10.177, 3.162, 4.288, 0.049));
outputVariable->addTerm(Linear::create("outmf11", engine, 37.596, 10.154, 3.162, 4.288, 0.181));
outputVariable->addTerm(Linear::create("outmf12", engine, 38.561, 10.177, 3.162, 4.288, 0.049));
outputVariable->addTerm(Linear::create("outmf13", engine, 40.408, 10.053, 3.162, 4.288, -0.207));
outputVariable->addTerm(Linear::create("outmf14", engine, 41.373, 10.030, 3.162, 4.288, -0.339));
outputVariable->addTerm(Linear::create("outmf15", engine, 40.408, 10.053, 3.162, 4.288, -0.207));
outputVariable->addTerm(Linear::create("outmf16", engine, 41.373, 10.030, 3.162, 4.288, -0.339));
engine->addOutputVariable(outputVariable);

RuleBlock* ruleBlock = new RuleBlock;
ruleBlock->setEnabled(true);
ruleBlock->setName("");
ruleBlock->setConjunction(new AlgebraicProduct);
ruleBlock->setDisjunction(fl::null);
ruleBlock->setActivation(fl::null);
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf1 and in3 is in3mf1 and in4 is in4mf1 then out is outmf1", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf1 and in3 is in3mf1 and in4 is in4mf2 then out is outmf2", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf1 and in3 is in3mf2 and in4 is in4mf1 then out is outmf3", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf1 and in3 is in3mf2 and in4 is in4mf2 then out is outmf4", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf2 and in3 is in3mf1 and in4 is in4mf1 then out is outmf5", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf2 and in3 is in3mf1 and in4 is in4mf2 then out is outmf6", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf2 and in3 is in3mf2 and in4 is in4mf1 then out is outmf7", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf1 and in2 is in2mf2 and in3 is in3mf2 and in4 is in4mf2 then out is outmf8", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf1 and in3 is in3mf1 and in4 is in4mf1 then out is outmf9", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf1 and in3 is in3mf1 and in4 is in4mf2 then out is outmf10", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf1 and in3 is in3mf2 and in4 is in4mf1 then out is outmf11", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf1 and in3 is in3mf2 and in4 is in4mf2 then out is outmf12", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf2 and in3 is in3mf1 and in4 is in4mf1 then out is outmf13", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf2 and in3 is in3mf1 and in4 is in4mf2 then out is outmf14", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf2 and in3 is in3mf2 and in4 is in4mf1 then out is outmf15", engine));
ruleBlock->addRule(fl::Rule::parse("if in1 is in1mf2 and in2 is in2mf2 and in3 is in3mf2 and in4 is in4mf2 then out is outmf16", engine));
engine->addRuleBlock(ruleBlock);


}
Exemplo n.º 7
0
int main(int argc, char** argv) {
    using namespace fl;

    Engine* engine = new Engine;
    engine->setName("Cubic-Approximator");

    InputVariable* inputVariable = new InputVariable;
    inputVariable->setEnabled(true);
    inputVariable->setName("X");
    inputVariable->setRange(-5.000, 5.000);
    inputVariable->addTerm(new Triangle("AboutNegFive", -6.000, -5.000, -4.000));
    inputVariable->addTerm(new Triangle("AboutNegFour", -5.000, -4.000, -3.000));
    inputVariable->addTerm(new Triangle("AboutNegThree", -4.000, -3.000, -2.000));
    inputVariable->addTerm(new Triangle("AboutNegTwo", -3.000, -2.000, -1.000));
    inputVariable->addTerm(new Triangle("AboutNegOne", -2.000, -1.000, 0.000));
    inputVariable->addTerm(new Triangle("AboutZero", -1.000, 0.000, 1.000));
    inputVariable->addTerm(new Triangle("AboutOne", 0.000, 1.000, 2.000));
    inputVariable->addTerm(new Triangle("AboutTwo", 1.000, 2.000, 3.000));
    inputVariable->addTerm(new Triangle("AboutThree", 2.000, 3.000, 4.000));
    inputVariable->addTerm(new Triangle("AboutFour", 3.000, 4.000, 5.000));
    inputVariable->addTerm(new Triangle("AboutFive", 4.000, 5.000, 6.000));
    engine->addInputVariable(inputVariable);

    OutputVariable* outputVariable = new OutputVariable;
    outputVariable->setEnabled(true);
    outputVariable->setName("ApproxXCubed");
    outputVariable->setRange(-5.000, 5.000);
    outputVariable->fuzzyOutput()->setAccumulation(fl::null);
    outputVariable->setDefuzzifier(new WeightedAverage("TakagiSugeno"));
    outputVariable->setDefaultValue(fl::nan);
    outputVariable->setLockPreviousOutputValue(false);
    outputVariable->setLockOutputValueInRange(false);
    outputVariable->addTerm(Linear::create("TangentatNegFive", engine, 75.000, 250.000));
    outputVariable->addTerm(Linear::create("TangentatNegFour", engine, 48.000, 128.000));
    outputVariable->addTerm(Linear::create("TangentatNegThree", engine, 27.000, 54.000));
    outputVariable->addTerm(Linear::create("TangentatNegTwo", engine, 12.000, 16.000));
    outputVariable->addTerm(Linear::create("TangentatNegOne", engine, 3.000, 2.000));
    outputVariable->addTerm(Linear::create("TangentatZero", engine, 0.000, 0.000));
    outputVariable->addTerm(Linear::create("TangentatOne", engine, 3.000, -2.000));
    outputVariable->addTerm(Linear::create("TangentatTwo", engine, 12.000, -16.000));
    outputVariable->addTerm(Linear::create("TangentatThree", engine, 27.000, -54.000));
    outputVariable->addTerm(Linear::create("TangentatFour", engine, 48.000, -128.000));
    outputVariable->addTerm(Linear::create("TangentatFive", engine, 75.000, -250.000));
    engine->addOutputVariable(outputVariable);

    RuleBlock* ruleBlock = new RuleBlock;
    ruleBlock->setEnabled(true);
    ruleBlock->setName("");
    ruleBlock->setConjunction(fl::null);
    ruleBlock->setDisjunction(fl::null);
    ruleBlock->setActivation(fl::null);
    ruleBlock->addRule(fl::Rule::parse("if X is AboutNegFive then ApproxXCubed is TangentatNegFive", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutNegFour then ApproxXCubed is TangentatNegFour", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutNegThree then ApproxXCubed is TangentatNegThree", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutNegTwo then ApproxXCubed is TangentatNegTwo", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutNegOne then ApproxXCubed is TangentatNegOne", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutZero then ApproxXCubed is TangentatZero", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutOne then ApproxXCubed is TangentatOne", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutTwo then ApproxXCubed is TangentatTwo", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutThree then ApproxXCubed is TangentatThree", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutFour then ApproxXCubed is TangentatFour", engine));
    ruleBlock->addRule(fl::Rule::parse("if X is AboutFive then ApproxXCubed is TangentatFive", engine));
    engine->addRuleBlock(ruleBlock);


}