Random Bond Factory

class RandomBondFactory(max_internal_bonds=4, required_bonds=(), max_bond_order=None, random_seed=None)[source]

Bases: vabene.bond.factories.bond_factory.BondFactory

Creates random collections of bonds.

The bonds yielded will not necessarily create a single molecule.

Parameters:
  • max_internal_bonds (int, optional) – Once all atoms have been connected into a single molecule, the factory will create a random number of internal bonds between atoms in the molecule. This sets the maximum number of such bonds.
  • required_bonds (tuple of Bond) – Bonds, which must be yielded by each get_bonds() call.
  • max_bond_order (int) – The maximum bond order the factory can make. If None the maximum will be the maximum shared valence between the two atoms.
  • random_seed (int, optional) – The random seed to use.

Methods

get_bonds(self, atoms) Yield the bonds of a molecule.
get_bonds(self, atoms)[source]

Yield the bonds of a molecule.

Parameters:atoms (tuple of Atom) – The atoms of the molecule.
Yields:Bond – A bond.