public class VectorVar
extends java.lang.Object
Defines a list of variables
Modifier and Type | Method and Description |
---|---|
double |
Adaptation(double x,
int variable)
Returns the adaptation degree of a certain value x to the variable in position "variable" of the list.
|
double |
Adaptation(double x,
int variable,
int dominio)
Returns the adaptation degree of a certain value x to the label "dominio" of the variable in position "variable" of the list.
|
double |
Adaptation(double x,
int variable,
java.lang.String dominio)
Returns the adaptation degree of a certain value x to a set of label "dominio" of the variable in position "variable" of the list.
|
double |
Adaptation(vectordouble x,
java.lang.String regla)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String
|
double |
Adaptation(vectordouble x,
java.lang.String regla,
double[] var,
double umbral)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String, taking into account the activation
threshold for the variables
|
double |
Adaptation(vectordouble x,
java.lang.String regla,
double[] var,
double umbral,
double umbral2)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String, taking into account the activation
threshold for the variables
|
void |
AdaptationC(vectordouble x,
int etiq,
java.util.ArrayList<double[]> milista)
Calculates the adaptation degree of set of values in "x" to a certain label "etiq".
|
double |
Area(int var,
int lab)
Returns the area of the label number "lab" in the variable in position "var" of the list.
|
double |
CenterLabel(int var,
int lab)
Returns the central value of the label number "lab" in the variable in position "var" of the list.
|
int |
Consequent()
Returns the position of the consequent inside the list of variables
|
domain_t |
Domain(int var)
Creates a new domain_t object containing the domain of the variable in position "var" of the list
|
void |
Encode(java.util.ArrayList<java.lang.Integer> milista)
Obtains the number of active antecedent variables and consequent variables in the list
|
fuzzy_t |
FuzzyLabel(int var,
int lab)
Returns a fuzzy_t object with the definition of the label number "lab" in the variable in position "var" of the list.
|
double |
Inf_Range(int var)
Returns the lower value of the definition interval of variable in position "var" of the list
|
boolean |
Is_Valid(java.lang.String regla,
double[] var,
double umbral,
java.util.ArrayList<java.lang.Double> milista)
Returns if the set rules encoded in the String "regla" is valid or not.
|
boolean |
IsActive(int variable)
Returns if the variable in position "variable" is considered in the learning process.
|
boolean |
IsAntecedent(int variable)
Retuns if the variable in position "variable" is an antecedent of the rule.
|
boolean |
IsDiscrete(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by crisp values.
|
boolean |
IsFuzzy(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by fuzzy sets.
|
boolean |
IsInterval(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by intervals.
|
int |
N_Antecedents()
It returns the number of antecedents in the list of variables
|
void |
PrintDefinition()
Prints in the standard output the definition of all the variables in the list
|
void |
PrintDefinition(int variable)
Prints in the standard output the definition of the variable in position "variable" in the list
|
java.lang.String |
PrintDefinitionToString()
Prints in a String the definition of all the variables in the list
|
void |
PrintDomain(int variable,
int value)
Prints in the standard ouput the name of the label "value" of the variable in position "variable" in the list.
|
void |
PrintVar(int variable)
Prints in the standard output the name of the variable in position "variable" in the list
|
void |
Set(int pos,
variable_t x)
Copies the variable "x" in the position "pos" of the list
|
int |
SizeDomain(int variable)
Retuns the number of labels in the variable in position "variable" of the list domain.
|
java.lang.String |
SPrintDomain(int variable,
int value)
Returns a string with the name of the label "value" of the variable in position "variable" in the list.
|
java.lang.String |
SPrintVar(int variable)
Returns a string with the name of the variable in position "variable" in the list
|
double |
Sup_Range(int var)
Returns the upper value of the definition interval of variable in position "var" of the list
|
int |
TotalVariables()
Retuns the number of variables in the list
|
variable_t |
Variable(int var)
Creates a new variable_t object containing the variable in position "var" of the list
|
public void Set(int pos, variable_t x)
Copies the variable "x" in the position "pos" of the list
pos
- int The position in the listx
- variable_t The variablepublic int N_Antecedents()
It returns the number of antecedents in the list of variables
public void Encode(java.util.ArrayList<java.lang.Integer> milista)
Obtains the number of active antecedent variables and consequent variables in the list
milista
- ArrayList It keeps the the number of active antecedent variables and consequent variables in the listpublic void PrintDefinition(int variable)
Prints in the standard output the definition of the variable in position "variable" in the list
variable
- variable id.public java.lang.String PrintDefinitionToString()
Prints in a String the definition of all the variables in the list
public void PrintDefinition()
Prints in the standard output the definition of all the variables in the list
public void PrintVar(int variable)
Prints in the standard output the name of the variable in position "variable" in the list
variable
- variable id.public java.lang.String SPrintVar(int variable)
Returns a string with the name of the variable in position "variable" in the list
variable
- variable id.public void PrintDomain(int variable, int value)
Prints in the standard ouput the name of the label "value" of the variable in position "variable" in the list.
variable
- int The variable in position in the listvalue
- int The label of the variablepublic java.lang.String SPrintDomain(int variable, int value)
Returns a string with the name of the label "value" of the variable in position "variable" in the list.
variable
- int The variable in position in the listvalue
- int The label of the variablepublic boolean IsActive(int variable)
Returns if the variable in position "variable" is considered in the learning process.
variable
- int The variable in position in the listpublic boolean IsAntecedent(int variable)
Retuns if the variable in position "variable" is an antecedent of the rule.
variable
- int The variable in position in the listpublic int TotalVariables()
Retuns the number of variables in the list
public int SizeDomain(int variable)
Retuns the number of labels in the variable in position "variable" of the list domain.
variable
- int The variable in position in the listpublic double Adaptation(double x, int variable)
Returns the adaptation degree of a certain value x to the variable in position "variable" of the list.
x
- double The valuevariable
- int The variable in position in the listpublic double Adaptation(double x, int variable, int dominio)
Returns the adaptation degree of a certain value x to the label "dominio" of the variable in position "variable" of the list.
x
- double The valuevariable
- int The variable in position in the listdominio
- int The label in the domainpublic double Adaptation(double x, int variable, java.lang.String dominio)
Returns the adaptation degree of a certain value x to a set of label "dominio" of the variable in position "variable" of the list. Param "dominio" is given as an ordered vector (String of strings) with zeros and ones representing the absence or the presence, respectively.
x
- double The valuevariable
- int The variable in position in the listdominio
- String The set of labels in the domainpublic double Adaptation(vectordouble x, java.lang.String regla)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String
x
- vectordouble The vector of valuesregla
- String The set of rulespublic boolean Is_Valid(java.lang.String regla, double[] var, double umbral, java.util.ArrayList<java.lang.Double> milista)
Returns if the set rules encoded in the String "regla" is valid or not. Its simplicity is also calculated
regla
- String The set of rulesvar
- double[] Contains the information measure for each variableumbral
- double Activation threshold (only variable with its information measure equal o greater than this value are considered in the rule).milista
- ArrayList Double Keeps the simplicity of the rulepublic double Adaptation(vectordouble x, java.lang.String regla, double[] var, double umbral)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String, taking into account the activation threshold for the variables
x
- vectordouble The vector of valuesregla
- String The set of rulesvar
- double[] Contains the information measure for each variableumbral
- double Activation threshold (only variable with its information measure equal o greater than this value are considered in the rule).public double Adaptation(vectordouble x, java.lang.String regla, double[] var, double umbral, double umbral2)
Returns the adaptation degree of set of values in "x" to a set rules enconded in a String, taking into account the activation threshold for the variables
x
- vectordouble The vector of valuesregla
- String The set of rulesvar
- double[] Contains the information measure for each variableumbral
- double Activation threshold (only variable with its information measure equal o greater than this value are considered in the rule).umbral2
- double Minimum adaptation threshold.public void AdaptationC(vectordouble x, int etiq, java.util.ArrayList<double[]> milista)
Calculates the adaptation degree of set of values in "x" to a certain label "etiq". Also calculates the adaptation degree to its complementary, that is, the rest of labels in the variable (not including "etiq").
x
- vectordouble The vector of valuesetiq
- int The label in the variablemilista
- ArrayList public double Area(int var, int lab)
Returns the area of the label number "lab" in the variable in position "var" of the list.
var
- int The position of the variablelab
- int The label numberpublic fuzzy_t FuzzyLabel(int var, int lab)
Returns a fuzzy_t object with the definition of the label number "lab" in the variable in position "var" of the list.
var
- int The position of the variablelab
- int The label numberpublic double CenterLabel(int var, int lab)
Returns the central value of the label number "lab" in the variable in position "var" of the list.
var
- int The position of the variablelab
- int The label numberpublic boolean IsDiscrete(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by crisp values.
var
- int The position of the variablepublic boolean IsInterval(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by intervals.
var
- int The position of the variablepublic boolean IsFuzzy(int var)
Returns if the domain associated to the variable in position "var" of the list is only formed by fuzzy sets.
var
- int The position of the variablepublic domain_t Domain(int var)
Creates a new domain_t object containing the domain of the variable in position "var" of the list
var
- int The position of the variablepublic variable_t Variable(int var)
Creates a new variable_t object containing the variable in position "var" of the list
var
- int The position of the variablepublic double Inf_Range(int var)
Returns the lower value of the definition interval of variable in position "var" of the list
var
- int The position of the variablepublic double Sup_Range(int var)
Returns the upper value of the definition interval of variable in position "var" of the list
var
- int The position of the variablepublic int Consequent()
Returns the position of the consequent inside the list of variables