Package org.openscience.cdk.structgen
Class SingleStructureRandomGenerator
java.lang.Object
org.openscience.cdk.structgen.SingleStructureRandomGenerator
Randomly generates a single, connected, correctly bonded structure for
a given molecular formula.
To see it working run the graphical
test org.openscience.cdk.test.SingleStructureRandomGeneratorTest
and add more structures to the panel using the "More" button.
In order to use this class, use MFAnalyser to get an AtomContainer from
a molecular formula string.
Assign hydrogen counts to each heavy atom. The hydrogens should not be in the atom pool but should be assigned implicitly to the heavy atoms in order to reduce computational cost. Assign this AtomContainer to the SingleStructureRandomGenerator and retrieve a randomly generated, but correctly bonded structure by using the generate() method. You can then repeatedly call the generate() method in order to retrieve further structures.
Agenda:
- add a method for randomly adding hydrogens to the atoms
- add a seed for random generator for reproducability
- Author:
- steinbeck
- Source code:
- main
- Belongs to CDK module:
- structgen
- Created on:
- 2001-09-04
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the SingleStructureRandomGenerator object.SingleStructureRandomGenerator
(long seed) Constructor for the SingleStructureRandomGenerator object. -
Method Summary
Modifier and TypeMethodDescriptiongenerate()
Generates a random structure based on the atoms in the given IAtomContainer.void
Sets the AtomContainer attribute of the SingleStructureRandomGenerator object.
-
Constructor Details
-
Method Details
-
setAtomContainer
Sets the AtomContainer attribute of the SingleStructureRandomGenerator object.- Parameters:
ac
- The new AtomContainer value
-
generate
Generates a random structure based on the atoms in the given IAtomContainer.- Throws:
CDKException
-