Class CrossoverMachine

java.lang.Object
org.openscience.cdk.structgen.stochastic.operator.CrossoverMachine

public class CrossoverMachine extends Object
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 Details

    • SPLIT_MODE_RADNDOM

      public static final int SPLIT_MODE_RADNDOM
      Indicates that crossover is using SPLIT_MODE_RADNDOM mode.
      See Also:
    • SPLIT_MODE_DEPTH_FIRST

      public static final int SPLIT_MODE_DEPTH_FIRST
      Indicates that crossover is using SPLIT_MODE_DEPTH_FIRST mode.
      See Also:
    • SPLIT_MODE_BREADTH_FIRST

      public static final int SPLIT_MODE_BREADTH_FIRST
      Indicates that crossover is using SPLIT_MODE_BREADTH_FIRST mode.
      See Also:
  • Constructor Details

    • CrossoverMachine

      public CrossoverMachine()
      Constructs a new CrossoverMachine operator.
  • Method Details

    • doCrossover

      public List<IAtomContainer> doCrossover(IAtomContainer dad, IAtomContainer mom) throws CDKException
      Performs the n point crossover of two IAtomContainer. 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.