public class Complex
extends java.lang.Object
implements java.lang.Comparable
Stores conjunctions of selectors
Constructor and Description |
---|
Complex()
Default constructor.
|
Complex(int nClas)
Constructor for Complex
|
Modifier and Type | Method and Description |
---|---|
void |
addSelector(Selector s)
Add the selector into the selector list
|
void |
adjuntNameAttributes(java.lang.String[] attributes)
Local copy of the name of variables
|
void |
clear()
Cleans the list
|
int |
compareTo(java.lang.Object o)
Compare two objects of the class
|
void |
computeLaPlace()
Calculate the value of laplace for a complex
|
int[] |
existingSelectors()
Return an array of size numAttributes.
|
int |
getClassAttribute()
Return the class that define the complex
|
int |
getDimensions() |
int[] |
getDistribution()
Return the value of the distribution
|
int |
getDistributionClass(int classAttribute)
Return the value of the distribution
|
double |
getHeuristic()
return the heuristic value of the complex
|
int |
getNClases()
Return the number of classes
|
Selector |
getSelector(int indice)
Return a selector in one position by giving a complex
|
double |
getVolume() |
double |
getWeight() |
void |
incrementDistribution(int classAttribute)
Add one to the n of the complex for the class
|
boolean |
isEqual(Complex c)
Check if two complex are equals (represent the same)
|
void |
print()
Print the content of the complex (List->Attribute operator value)
|
void |
printDistribucion()
Print the classes distribution for the complex
|
java.lang.String |
printDistribucionString()
Print the classes distribution for the complex
|
java.lang.String |
printString(int[] numValues)
Print the complex content using a string (List->Attribute operator value)
|
void |
removeDistribution()
reset the distribution value for the complex
|
void |
removeSelector(Selector s)
Drop the selector of the list selectors
|
void |
removeSelectorAttribute(int attribute)
Removes the selectors that have the attribute given as argument from the proper list
|
boolean |
ruleCoversInstance(double[] ejemplo)
Check if the rule match with the parameter instance
|
void |
setClassAttribute(int clase)
Gives the value of the class to the complex
|
void |
setDimensions(int d) |
void |
setHeuristic(double heuristic)
Assign a heuristic value (Wracc) to the complex
|
void |
setVolume(double v) |
void |
setWeight(double w) |
int |
size()
Return the size complex
|
public Complex()
public Complex(int nClas)
nClas
- int number of classespublic int compareTo(java.lang.Object o)
Compare two objects of the class
compareTo
in interface java.lang.Comparable
o
- complex to comparepublic boolean isEqual(Complex c)
Check if two complex are equals (represent the same)
c
- El complex to comparepublic void addSelector(Selector s)
Add the selector into the selector list
s
- the selector (set atr. op. value)public void removeSelector(Selector s)
Drop the selector of the list selectors
s
- the selector (set atr. op. value)public void removeSelectorAttribute(int attribute)
Removes the selectors that have the attribute given as argument from the proper list
attribute
- given attribute.public void clear()
Cleans the list
public Selector getSelector(int indice)
Return a selector in one position by giving a complex
indice
- Position inside the complexpublic int size()
Return the size complex
public int getNClases()
Return the number of classes
public int getClassAttribute()
Return the class that define the complex
public void setClassAttribute(int clase)
Gives the value of the class to the complex
clase
- int The classpublic void setWeight(double w)
public double getWeight()
public void setVolume(double v)
public double getVolume()
public void setDimensions(int d)
public int getDimensions()
public void computeLaPlace()
Calculate the value of laplace for a complex
public boolean ruleCoversInstance(double[] ejemplo)
Check if the rule match with the parameter instance
ejemplo
- The instancepublic double getHeuristic()
return the heuristic value of the complex
public void setHeuristic(double heuristic)
Assign a heuristic value (Wracc) to the complex
heuristic
- heuristic valuepublic void removeDistribution()
reset the distribution value for the complex
public void incrementDistribution(int classAttribute)
Add one to the n of the complex for the class
classAttribute
- int value of the classpublic int getDistributionClass(int classAttribute)
Return the value of the distribution
classAttribute
- int index of the classpublic int[] getDistribution()
Return the value of the distribution
public void print()
Print the content of the complex (List->Attribute operator value)
public java.lang.String printString(int[] numValues)
Print the complex content using a string (List->Attribute operator value)
numValues
- number of values.public void printDistribucion()
Print the classes distribution for the complex
public java.lang.String printDistribucionString()
Print the classes distribution for the complex
public void adjuntNameAttributes(java.lang.String[] attributes)
Local copy of the name of variables
attributes
- String[] stores the name of the variablespublic int[] existingSelectors()
Return an array of size numAttributes. Each content 1 if selector exists, 0 otherwise