org.jgap.gp.impl
Class BranchTypingCross
- java.lang.Object
-
- org.jgap.gp.CrossMethod
-
- org.jgap.gp.impl.BranchTypingCross
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
public class BranchTypingCross extends CrossMethod implements java.io.Serializable, java.lang.Comparable, java.lang.Cloneable
Crossing over for GP ProgramChromosomes.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BranchTypingCross(GPConfiguration a_config)Standard constructor.BranchTypingCross(GPConfiguration a_config, boolean a_simpleChromosomeSelection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()intcompareTo(java.lang.Object a_other)The compareTo-method.booleanequals(java.lang.Object a_other)The equals-method.IGPProgram[]operate(IGPProgram a_i1, IGPProgram a_i2)Crosses two individuals.-
Methods inherited from class org.jgap.gp.CrossMethod
getConfiguration
-
-
-
-
Constructor Detail
-
BranchTypingCross
public BranchTypingCross(GPConfiguration a_config)
Standard constructor.- Parameters:
a_config- the configuration to use
-
BranchTypingCross
public BranchTypingCross(GPConfiguration a_config, boolean a_simpleChromosomeSelection)
- Parameters:
a_config- the configuration to usea_simpleChromosomeSelection- true: plainly select chromosomes, false: select chromosomes proportionally to their size (=number of nodes within a chromosome)- Since:
- 3.4
-
-
Method Detail
-
operate
public IGPProgram[] operate(IGPProgram a_i1, IGPProgram a_i2)
Crosses two individuals. A random chromosome is chosen for crossing based on the proportion of nodes in each chromosome in the first individual.- Specified by:
operatein classCrossMethod- Parameters:
a_i1- the first individual to crossa_i2- the second individual to cross- Returns:
- an array of the two resulting individuals
- Since:
- 3.0
-
compareTo
public int compareTo(java.lang.Object a_other)
The compareTo-method.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
a_other- the other object to compare- Returns:
- 0 or 1 in this case, as BranchTypingCross objects keep no state
- Since:
- 3.0
-
equals
public boolean equals(java.lang.Object a_other)
The equals-method.- Overrides:
equalsin classjava.lang.Object- Parameters:
a_other- the other object to compare- Returns:
- always true for non-null BranchTypingCross objects because they keep no state
- Since:
- 3.0
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object- Returns:
- deep clone of this instance
- Since:
- 3.2
-
-
DMelt 3.0 © DataMelt by jWork.ORG