mirror of
https://github.com/marcin-szczepanski/jFuzzyLogic.git
synced 2024-11-03 17:50:28 +01:00
Fix
This commit is contained in:
parent
3bfa35fa40
commit
c5f53a2a50
@ -1,7 +1,5 @@
|
||||
//--------------------------------------------------------------------------------
|
||||
// Code generated by jFuzzyLogic
|
||||
// jFuzzyLogic Version : JFuzzyLogic 4.0 (build 2022-05-12), by Pablo Cingolani
|
||||
// jFuzzyLogic created by Pablo Cingolani
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
function ruleAccumulationMethod_max(defuzzifierValue, valueToAggregate) {
|
||||
@ -205,4 +203,6 @@ function main(food, service) {
|
||||
|
||||
// Show results
|
||||
tipper.print();
|
||||
|
||||
return [tipper.tip];
|
||||
}
|
||||
|
Binary file not shown.
@ -3,11 +3,7 @@ package net.sourceforge.jFuzzyLogic;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.*;
|
||||
|
||||
import net.sourceforge.jFuzzyLogic.fcl.FclLexer;
|
||||
import net.sourceforge.jFuzzyLogic.fcl.FclObject;
|
||||
@ -347,8 +343,6 @@ public class FIS extends FclObject implements Iterable<FunctionBlock>, CompileCp
|
||||
|
||||
out.append("//--------------------------------------------------------------------------------\n");
|
||||
out.append("// Code generated by jFuzzyLogic\n");
|
||||
out.append("// jFuzzyLogic Version : " + JFuzzyLogic.VERSION + " \n");
|
||||
out.append("// jFuzzyLogic created by Pablo Cingolani\n");
|
||||
out.append("//--------------------------------------------------------------------------------\n\n");
|
||||
|
||||
// Sort function blocks by name
|
||||
@ -443,6 +437,28 @@ public class FIS extends FclObject implements Iterable<FunctionBlock>, CompileCp
|
||||
out.append("\t// Show results\n");
|
||||
for (String name : fbNames)
|
||||
out.append("\t" + name + ".print();\n");
|
||||
|
||||
out.append("\n\treturn [");
|
||||
for (String name : fbNames) {
|
||||
FunctionBlock functionBlock = getFunctionBlock(name);
|
||||
int k = 0;
|
||||
List<Variable> outs = new ArrayList<>();
|
||||
for (Variable var : functionBlock.variablesSorted()) {
|
||||
if (var.isOutput()) {
|
||||
outs.add(var);
|
||||
}
|
||||
}
|
||||
for (Variable var : outs) {
|
||||
if (var.isOutput()) {
|
||||
out.append(name + "." + var.getName());
|
||||
if (k < outs.size() - 1) {
|
||||
out.append(", ");
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
out.append("];\n");
|
||||
out.append("}");
|
||||
|
||||
return out.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user