public class GenotypeFuzzyGPRegSym extends Genotype
GenotypeFuzzyGPRegSym is the base clase to represent the genotype when a fuzzy
model symbolic regression is to be learned with the genetic programming (GP).
Both the constants and the tree node are learned.
The Fuzzy model variables are characterized with FuzzyPartition
s.
The root node is a NodeExprHold
.
Constructor and Description |
---|
GenotypeFuzzyGPRegSym(double kmin,
double kmax,
int pNInputs,
int cteType,
int vChainLength,
int mh,
Randomize r)
Class constructor with the following parameters:
|
GenotypeFuzzyGPRegSym(GenotypeFuzzyGPRegSym p)
The copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Genotype |
clone()
This method is intended for generating a perfect copy of the current Genotype.
|
void |
crossover(Genotype p2,
Genotype p3,
Genotype p4,
int crossoverID)
The method for carrying out the crossover genetic operations.
|
void |
debug()
This method is intended for printing debug information.
|
double[] |
getChainValue()
This method returns the centre of weights of the vector fsChain.
|
int |
getNumInputs()
Returns the number of inputs
|
Node |
getRootNode()
This method returns the root node.
|
boolean[] |
getUsedConstants()
This method returns the list of used constants.
|
boolean |
isRelated(Genotype g)
This method determines if the given
Genotype is of the same
type thant the current object. |
void |
mutation(double AMPL,
int mutationID)
Method for carrying out the mutation genetic operations.
|
void |
Random()
The method intended to randomly initialize a Genotype and then the corresponding individual.
|
void |
rebuild(Genotype g)
This method is intended to rebuild the current object if needed.
|
void |
setChain(double[] x)
This method sets the fsChain with the given array value
|
void |
setTree(GenotypeFuzzyGPRegSym p)
This method copies the given parameter into the current object.
|
public GenotypeFuzzyGPRegSym(double kmin, double kmax, int pNInputs, int cteType, int vChainLength, int mh, Randomize r)
Class constructor with the following parameters:
kmin
- the minimum double value for each constantkmax
- the maximum double value for each constantpNInputs
- the number of input variablescteType
- the type of value used: FuzzyRegressor.Crisp for crisp values,
FuzzyRegressor.Interval for interval values and
FuzzyRegressor.Fuzzy for fuzzy valuesvChainLength
- the length of the FuzzyAlphaCut
arraymh
- the maximum valid tree heightr
- the Randomize
objectpublic GenotypeFuzzyGPRegSym(GenotypeFuzzyGPRegSym p)
The copy constructor.
p
- the GenotypeFuzzyGPRegSym
to be copiedpublic void setTree(GenotypeFuzzyGPRegSym p)
This method copies the given parameter into the current object.
p
- the GenotypeFuzzyGPRegSym
to be copiedpublic boolean isRelated(Genotype g)
This method determines if the given Genotype
is of the same
type thant the current object.
The nodes are analyzed to be the same tree without considering the
constants values.
public Genotype clone()
This method is intended for generating a perfect copy of the current Genotype.
public void rebuild(Genotype g)
This method is intended to rebuild the current object if needed. In this case, nothing has to be done.
g
- the Genotype
to rebuild.public int getNumInputs()
public void mutation(double AMPL, int mutationID) throws invalidMutation
Method for carrying out the mutation genetic operations.
mutation
in class Genotype
AMPL
- double value kept for compatibility, not used.mutationID
- an int with the crossover operation to be carried out:
OperatorIdent.GAPMUTAGA for the genetic algorithm mutation
OperatorIdent.GAPMUTAGP for the genetic programming mutationinvalidMutation
- if mutationID is not validpublic void crossover(Genotype p2, Genotype p3, Genotype p4, int crossoverID) throws invalidCrossover
The method for carrying out the crossover genetic operations.
crossover
in class Genotype
p2
- the second parent in the crossover operation, it's an Genotype
objectp3
- the Genotype
object with the first offspringp4
- the Genotype
object with the second offspringcrossoverID
- an int with the crossover operation to be carried out:
OperatorIdent.GAPCRUCEGA for genetic algorithm crossover
OperatorIdent.GAPCRUCEGP for genetic programming crossoverinvalidCrossover
- if crossoverID is not validpublic void Random()
The method intended to randomly initialize a Genotype and then the corresponding individual.
public void debug()
This method is intended for printing debug information.
public double[] getChainValue()
This method returns the centre of weights of the vector fsChain.
public boolean[] getUsedConstants()
This method returns the list of used constants.
public void setChain(double[] x)
This method sets the fsChain with the given array value
x
- the new double array for the fsChain