public class Selector
extends java.lang.Object
Title: Selector (Selector).
Description: This class implements a Selector or Antecedent of a rule (An attribute with a given condition).
Modifier and Type | Field and Description |
---|---|
static int |
IGUAL
Identifier for the equal condition operator.
|
static int |
MAYOR
Identifier for the greater condition operator.
|
static int |
MENOR_IGUAL
Identifier for the lesser-equal condition operator.
|
Constructor and Description |
---|
Selector()
Default Constructor.
|
Selector(int atributo,
myDataset train)
Paramenter constructor.
|
Selector(java.lang.String atributo,
java.lang.String operador,
java.lang.String valor)
Paramenter constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
adjuntaNombres(java.lang.String[] atributos)
Sets the attributes names with the given ones.
|
Selector |
copia()
Returns a copy of the Selector.
|
boolean |
cubre(double[] ejemplo)
Checks if an example given is covered by the selector.
|
int |
getAtributo()
Returns the antecedent attribute of this selector.
|
void |
modifica(double[] ejemplo)
Modifies slightly the selector to cover the given example.
|
void |
mutar()
Mutates the selector by chaging the condition value.
|
java.lang.String |
printString()
Returns String representation of the Selector.
|
public static int IGUAL
public static int MENOR_IGUAL
public static int MAYOR
public Selector()
public Selector(java.lang.String atributo, java.lang.String operador, java.lang.String valor)
atributo
- attribute of the antecedent.operador
- condition operator.valor
- condition value.public Selector(int atributo, myDataset train)
atributo
- attribute of the antecedent.train
- training dataset.public void adjuntaNombres(java.lang.String[] atributos)
atributos
- Attributes names.public java.lang.String printString()
public Selector copia()
public boolean cubre(double[] ejemplo)
ejemplo
- given example.public void modifica(double[] ejemplo)
ejemplo
- double[] given example.public int getAtributo()
public void mutar()