Class CrossoverMachine
java.lang.Object
org.openscience.cdk.structgen.stochastic.operator.CrossoverMachine
Modified molecular structures by applying crossover operator on a pair of parent structures
and generate a pair of offspring structures. Each of the two offspring structures inherits
a certain fragments from both of its parents.
- Source code:
- main
- Belongs to CDK module:
- structgen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Indicates thatcrossover
is using SPLIT_MODE_BREADTH_FIRST mode.static final int
Indicates thatcrossover
is using SPLIT_MODE_DEPTH_FIRST mode.static final int
Indicates thatcrossover
is using SPLIT_MODE_RADNDOM mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoCrossover
(IAtomContainer dad, IAtomContainer mom) Performs the n point crossover of twoIAtomContainer
.
-
Field Details
-
SPLIT_MODE_RADNDOM
public static final int SPLIT_MODE_RADNDOMIndicates thatcrossover
is using SPLIT_MODE_RADNDOM mode.- See Also:
-
SPLIT_MODE_DEPTH_FIRST
public static final int SPLIT_MODE_DEPTH_FIRSTIndicates thatcrossover
is using SPLIT_MODE_DEPTH_FIRST mode.- See Also:
-
SPLIT_MODE_BREADTH_FIRST
public static final int SPLIT_MODE_BREADTH_FIRSTIndicates thatcrossover
is using SPLIT_MODE_BREADTH_FIRST mode.- See Also:
-
-
Constructor Details
-
CrossoverMachine
public CrossoverMachine()Constructs a new CrossoverMachine operator.
-
-
Method Details
-
doCrossover
Performs the n point crossover of twoIAtomContainer
. Precondition: The atoms in the molecules are ordered by properties to preserve (e. g. atom symbol). Due to its randomized nature, this method fails in around 3% of all cases. A CDKException with message "Could not mate these properly" will then be thrown.- Returns:
- The children.
- Throws:
CDKException
- if it was not possible to form offsprings.
-