public class Regla
extends java.lang.Object
Title: Regla (Rule)
Description:Rule class. Represents a rule extracted by the ACO algorithm.
Constructor and Description |
---|
Regla()
Default constructor.
|
Regla(Regla regla)
Copy Constructor.
|
Regla(java.util.Vector conjuntoAtributos,
Atributo claseOriginal)
Parameter Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
asignarCalidad(float original)
Assigns the given quality to the rule.
|
void |
asignarMuestrasCubiertas(float numero)
Sets the number of examples covered by the rule.
|
void |
copia(Regla regla)
Copies the rule given as argument.
|
boolean |
cubreMuestra(Muestra ejemplo)
Checks if the given example is covered by the whole rule
(covered by the conditions and with the same class of the rule).
|
void |
eliminaCondicion(Atributo condicion)
Removes the condition passed as parameter.
|
boolean |
esIgual(Regla regla)
Checks if the rule is equal to the given one.
|
boolean |
estaAtributo(Atributo original)
Checks if the given attribute/condition is already in the example.
|
boolean |
estanAtributosEn(Muestra mt)
Checks if in the sample, all the rule conditions/attributes are found.
|
void |
imprime()
Prints on the standard output the rule.
|
void |
imprimeFichero(java.io.PrintStream salida)
Prints on the given file (PrintStream) the rule.
|
void |
insertaAtributos(java.util.Vector atributos)
Adds all the conditions given.
|
void |
insertarAtributo(Atributo original)
Adds a condition (an attribute with its value and an operator).
|
void |
insertarClase(Atributo original)
Adds a class that identifies the rule with all its attributes.
|
java.util.Vector |
listaCondiciones()
Returns the list of conditions of the rule.
|
float |
obtenerCalidad()
Returns the quality of the rule.
|
static ComparadorRegla |
obtenerComparador()
Returns the rules comparative method.
|
float |
obtenerMuestrasCubiertas()
Returns the number of covered samples.
|
int |
obtenerNumCondiciones()
Returns the number of conditions in the rule.
|
Atributo |
obtenerReglaPredicha()
Returns the predicted class for the rule.
|
void |
ordenaAtributos()
Sorts the attributs in increasing order.
|
Atributo |
prediccion(Muestra mt)
Returns the predicted class of the given sample it they have compatible conditions,
null otherwise.
|
boolean |
tieneValorAtributo(int atributo)
Checks if the given attribute is already in the rule with a value.
|
public Regla()
public Regla(Regla regla)
regla
- rule to be copied.public Regla(java.util.Vector conjuntoAtributos, Atributo claseOriginal)
conjuntoAtributos
- Atributes values VectorclaseOriginal
- String class to set.public void insertarAtributo(Atributo original)
original
- Condition
condition to add.public void insertarClase(Atributo original)
original
- Atributo
class added to the rule.public void ordenaAtributos()
public void asignarCalidad(float original)
original
- double Quality to assign.public void asignarMuestrasCubiertas(float numero)
numero
- int number of covered examples to be set.public boolean estaAtributo(Atributo original)
original
- given attribute to be checked.public boolean tieneValorAtributo(int atributo)
atributo
- given attribute to be checked.public Atributo prediccion(Muestra mt)
mt
- Muestra
given sample.public boolean cubreMuestra(Muestra ejemplo)
ejemplo
- given example to check.public boolean estanAtributosEn(Muestra mt)
mt
- Sample to check.public Atributo obtenerReglaPredicha()
public java.util.Vector listaCondiciones()
public float obtenerCalidad()
public void imprime()
public void imprimeFichero(java.io.PrintStream salida)
salida
- given file (PrintStream).public int obtenerNumCondiciones()
public void insertaAtributos(java.util.Vector atributos)
atributos
- Vector of conditions to add.public void eliminaCondicion(Atributo condicion)
condicion
- condition to be removed.public boolean esIgual(Regla regla)
regla
- Rule to compare with.public static ComparadorRegla obtenerComparador()
public void copia(Regla regla)
regla
- rule to be copied.public float obtenerMuestrasCubiertas()