1package denoptim.graph.rings;
3import java.util.ArrayList;
4import java.util.Collections;
5import java.util.Iterator;
7import java.util.logging.Level;
9import org.openscience.cdk.interfaces.IAtomContainer;
11import denoptim.exception.DENOPTIMException;
12import denoptim.fragspace.FragmentSpace;
13import denoptim.graph.DGraph;
14import denoptim.graph.Fragment;
15import denoptim.graph.Ring;
16import denoptim.graph.Vertex;
17import denoptim.graph.Edge.BondType;
67 this.settings = rcParams;
70 this.originalMol = iac;
97 List<Ring> combOfRings =
new ArrayList<Ring>();
98 while (wLstVrtI.size() > 0)
105 Vertex vI = wLstVrtI.get(vIdI);
106 wLstVrtI.removeAll(Collections.singleton(vI));
110 while (wLstVrtJ.size() > 0)
113 Vertex vJ = wLstVrtJ.get(vIdJ);
114 wLstVrtJ.removeAll(Collections.singleton(vJ));
120 ArrayList<Vertex> arrLst =
new ArrayList<Vertex>();
126 if (bndTypI != bndTypJ)
128 String s =
"Attempt to close rings is not compatible "
129 +
"to the different bond type specified by the "
130 +
"head and tail APs: (" + bndTypI +
"!="
131 + bndTypJ +
" for vertices " + vI +
" "
133 throw new IllegalArgumentException(s);
137 combOfRings.add(ring);
139 wLstVrtI.removeAll(Collections.singleton(vJ));
Class defining a space of building blocks.
Container for the list of vertices and the edges that connect them.
Class representing a continuously connected portion of chemical object holding attachment points.
This class represents the closure of a ring in a spanning tree.
void setBondType(BondType bndType)
Set the bond type (i.e., bond order) of the chord connecting the head and the tail vertices.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
Edge getEdgeToParent()
Looks into the edges that use any of the APs that belong to this vertex and returns the edge that has...
This object represents a path in a DGraph.
List< Vertex > getVertecesPath()
Returns the list of verteces involved.
A class for iterating over sets of ring combinations generated by considering any constrain and setti...
boolean hasNext()
Always returns true because we allow duplicates.
int maxRingClosures
Max number of ring closures to consider in a valid combination of rings.
FragmentSpace fragSpace
Space of building blocks.
RandomCombOfRingsIterator(IAtomContainer iac, DGraph molGraph, int maxRingClosures, FragmentSpace fragSpace, RingClosureParameters rcParams)
Constructs an iterator.
IAtomContainer originalMol
Chemical representation of the system we work with.
RingClosureParameters settings
Parameters related to rings.
DGraph molGraph
Graph representation of the system we work with.
Parameters and setting related to handling ring closures.
Utility class to calculate and manage the alternative ring sizes achievable by formation of Rings.
List< Vertex > getRSBiasedListOfCandidates()
void addRingClosingBond(Vertex vI, Vertex vJ)
void initialize(IAtomContainer origMol, DGraph graph)
Makes this ring size manager work on a specific system that has a molecular representation and a DENO...
void setVertexAsDone(Vertex v)
Randomizer getRandomizer()
Returns the current program-specific randomizer.
int nextInt(int i)
Returns a pseudo-random, uniformly distributed int value between 0 (inclusive) and the specified valu...
Possible chemical bond types an edge can represent.