|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectclassifier.gp.CrossoverPlain
Implementation of the classical crossover operator
| Field Summary | |
protected double |
external
|
protected GProgram |
female
|
protected double |
internal
|
protected GProgram |
male
|
protected int |
max_depth
|
| Constructor Summary | |
CrossoverPlain(int max_depth,
double internal,
boolean keep)
Inizialize the parameters of the crossover |
|
| Method Summary | |
double |
getExternaleRate()
Probability that a external node is chosen as a crossover point |
double |
getInternalRate()
Probability that a internal node is chosen as a crossover point |
int |
getMaxDepth()
Maximum allowable depth of the resulting tree |
void |
setExternalRate(double external)
To change the probability that a external node is chosen as a crossover point |
void |
setInternalRate(double internal)
To change the probability that a internal node is chosen as a crossover point |
void |
setMaxDetph(int max)
To change the maximum allowable depth of a tree |
GProgram[] |
start(GProgram[] programs)
Method to start the crossover operation |
(package private) void |
validateCrossover(GProgram male,
GProgram female,
GProgram[] offspring)
To check if the result of a crossover is valid, if it's not and keep==true then the crossover operation will be repeated recursively |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected GProgram male
protected GProgram female
protected int max_depth
protected double internal
protected double external
| Constructor Detail |
public CrossoverPlain(int max_depth,
double internal,
boolean keep)
max_depth - Maximum allowable depth of the resulting treeinternal - Probability [0..1] that a internal node is chosen as a crossover pointkeep - if it is true the crossover will be repeated until a pair of valid children in found| Method Detail |
public int getMaxDepth()
public double getInternalRate()
public double getExternaleRate()
public void setMaxDetph(int max)
max - new integer value of the maximum depthpublic void setInternalRate(double internal)
internal - a double value in the range of [0..1]public void setExternalRate(double external)
external - a double value in the range of [0..1]public GProgram[] start(GProgram[] programs)
start in interface CrossoverOperatorprograms - Array of 2 GProgram containing the parents
void validateCrossover(GProgram male,
GProgram female,
GProgram[] offspring)
male - a parentfemale - the other parentoffspring - array of 2 GProgram that contain the offspring that have to be checked
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||