|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnxtfuzzylogic.NXTFuzzyLogic
public class NXTFuzzyLogic
Class responsible for definition and execution of fuzzy logic controller.
Field Summary | |
---|---|
static int |
BDIF
AND operator - Bounded difference |
static int |
COA
Deffuzification method - Center of Area |
static int |
COG
Deffuzification method - Center of Gravity |
static int |
LM
Deffuzification method - Left Most Maximum |
static int |
MIN
AND operator - Minimum |
static int |
PROD
AND operator - Product |
static int |
RM
Deffuzification method - Right Most Maximum |
Constructor Summary | |
---|---|
NXTFuzzyLogic()
Default constructor. |
Method Summary | |
---|---|
void |
defineInputLinguisticVariable(java.lang.String name,
float min,
float max,
float defaultValue)
Defines input linguistic variable. |
void |
defineOutputLinguisticVariable(java.lang.String name,
float min,
float max,
float defaultValue,
int defuzzyficationMethod)
Defines output linguistic variable. |
void |
defineRule(java.lang.String[] conditions,
java.lang.String conclusion,
int agregationMethod)
Function to define fuzzy rules. |
void |
defineTermSingleton(java.lang.String name,
java.lang.String linguisticVariableName,
float value)
Defines singleton term. |
void |
defineTermSType(java.lang.String name,
java.lang.String linguisticVariableName,
float left0,
float left1)
Defines S shape term. |
void |
defineTermTrapezoidal(java.lang.String name,
java.lang.String linguisticVariableName,
float left0,
float left1,
float right1,
float right0)
Defines trapezoidal term. |
void |
defineTermTriangular(java.lang.String name,
java.lang.String linguisticVariableName,
float left0,
float middle,
float right0)
Defines triangular term |
void |
defineTermZType(java.lang.String name,
java.lang.String linguisticVariableName,
float right1,
float right0)
Defines Z shape term. |
void |
evaluate()
Computes output of fuzzy controller. |
float |
getOutputValue(java.lang.String name)
Gets output value of OutputLinguisticVariable . |
void |
init()
Initializes the data defined by user. |
void |
setInputValue(java.lang.String name,
float value)
Sets input value of InputLinguisticVariable . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COG
public static final int COA
public static final int LM
public static final int RM
public static final int MIN
public static final int PROD
public static final int BDIF
Constructor Detail |
---|
public NXTFuzzyLogic()
Method Detail |
---|
public void setInputValue(java.lang.String name, float value)
InputLinguisticVariable
. Call before evaluate.
name
- Input linguistic variable namevalue
- Value to setpublic float getOutputValue(java.lang.String name)
OutputLinguisticVariable
. Call after evaluate.
name
- Output linguistic variable name
public void defineOutputLinguisticVariable(java.lang.String name, float min, float max, float defaultValue, int defuzzyficationMethod)
Defines output linguistic variable.
name
- linguistic variable namemin
- the lowest value for this linguistic variablemax
- the highest valuedefaultValue
- default valuedefuzzyficationMethod
- defuzzyfication method:
COG
COA
LM
RM
public void defineInputLinguisticVariable(java.lang.String name, float min, float max, float defaultValue)
name
- linguistic variable namemin
- the lowest valuemax
- the highest valuedefaultValue
- default valuepublic void defineTermTriangular(java.lang.String name, java.lang.String linguisticVariableName, float left0, float middle, float right0)
Defines triangular term
name
- name of the termlinguisticVariableName
- name of the linguistic variable described by this termleft0
- left bottom vertical of the trianglemiddle
- upper vertical of the triangleright0
- right bottom vertical of the trianglepublic void defineTermTrapezoidal(java.lang.String name, java.lang.String linguisticVariableName, float left0, float left1, float right1, float right0)
Defines trapezoidal term.
name
- name of the termlinguisticVariableName
- name of the linguistic variable described by this termleft0
- left bottom vertical of the trapezoidleft1
- left upper vertical of the trapezoidright1
- right upper vertical of the trapezoidright0
- right bottom vertical of the trapezoidpublic void defineTermSingleton(java.lang.String name, java.lang.String linguisticVariableName, float value)
name
- name of the termlinguisticVariableName
- name of the linguistic variable described by this termvalue
- value in which member function is equal to one.public void defineTermSType(java.lang.String name, java.lang.String linguisticVariableName, float left0, float left1)
name
- name of the termlinguisticVariableName
- name of the linguistic variable described by this termleft0
- Maximum value in which membership function takes zero.left1
- Minimum value in which membership function takes one.public void defineTermZType(java.lang.String name, java.lang.String linguisticVariableName, float right1, float right0)
name
- name of termlinguisticVariableName
- name of the linguistic variable described by this termright1
- Minimum value in which membership function takes one.right0
- Maximum value in which membership function takes zero.public void defineRule(java.lang.String[] conditions, java.lang.String conclusion, int agregationMethod)
defineRule(new String[] {"negSmall", "backSmall"}, "backFast", NXTFuzzyLogic.MIN)
conditions
- condtions terms namesconclusion
- conclusion term nameagregationMethod
- agregation method:
MIN
PROD
BDIF
public void init()
public void evaluate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |