JS - dodanie funkcji gaussa

This commit is contained in:
marcin-szczepanski 2023-04-21 20:50:14 +02:00
parent d9b7260030
commit 5d4da97dda
2 changed files with 7 additions and 0 deletions

View File

@ -66,4 +66,11 @@ public class MembershipFunctionGaussian extends MembershipFunctionContinuous {
public String toStringFcl() { public String toStringFcl() {
return "GAUSS " + parameters[0] + " " + parameters[1]; return "GAUSS " + parameters[0] + " " + parameters[1];
} }
@Override
public String toStringJS() {
StringBuilder sb = new StringBuilder();
sb.append("\t\treturn Math.exp(-(x - " + parameters[0] + ") * (x - " + parameters[0] + ") / (2 * " + parameters[1] + " * " + parameters[1] + "));\n");
return sb.toString();
}
} }