#80 -- fix consequents

This commit is contained in:
Anton Romanov 2023-02-01 00:15:59 +04:00
parent 1cd53459ed
commit 412d22fafd

View File

@ -56,7 +56,7 @@ public class FuzzyInferenceService {
dbRule.getFirstAntecedentValue().getAntecedentValue(),
dbRule.getSecondAntecedent().name(),
dbRule.getSecondAntecedentValue().getAntecedentValue(),
dbRule.getConsequent());
dbRule.getConsequent().replaceAll(" ", "_"));
}
private RuleBlock getRuleBlock(Engine engine,
@ -86,7 +86,7 @@ public class FuzzyInferenceService {
output.setDefaultValue(Double.NaN);
output.setLockValueInRange(false);
for (int i = 0; i < consequentValues.size(); i++) {
output.addTerm(new Triangle(consequentValues.get(i), i - 0.1, i + 2.1));
output.addTerm(new Triangle(consequentValues.get(i).replaceAll(" ", "_"), i - 0.1, i + 2.1));
}
engine.addOutputVariable(output);