19package denoptim.utils;
22import java.util.ArrayList;
25import org.openscience.cdk.interfaces.IAtom;
26import org.openscience.cdk.interfaces.IAtomContainer;
28import denoptim.graph.Ring;
29import denoptim.graph.Vertex;
30import denoptim.graph.rings.RingClosingAttractor;
52 public static ArrayList<RingClosingAttractor>
findAttractors(IAtomContainer mol)
54 ArrayList<RingClosingAttractor> attractors =
55 new ArrayList<RingClosingAttractor>();
57 for (IAtom atm : mol.atoms())
77 if (oldCmb.size() != ringsComb.size())
84 for (
Ring rA : oldCmb)
86 Vertex headA = rA.getHeadVertex();
87 Vertex tailA = rA.getTailVertex();
88 for (
Ring rB : ringsComb)
90 if (rA.getSize() != rB.getSize())
94 if (rB.contains(headA))
96 Vertex headB = rB.getHeadVertex();
97 Vertex tailB = rB.getTailVertex();
98 if ((headA == headB && tailA != tailB) ||
99 (headA == tailB && tailA != headB))
103 else if ((headA == headB && tailA == tailB) ||
104 (headA == tailB && tailA == headB))
111 if (oldCmb.size() != checkedRings)
This class represents the closure of a ring in a spanning tree.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
boolean isAttractor()
Checks whether the constructed RingClosingAttractor does corresponds to a RingClosingAttractor in the...
Toolbox useful when dealing with Ring Closing Attractors and ring closures.
static boolean areSameRingsSet(List< Ring > oldCmb, List< Ring > ringsComb)
Compares two combinations of DENOPTIMRingss and evaluates whether these correspond to the same combin...
static ArrayList< RingClosingAttractor > findAttractors(IAtomContainer mol)
Looks for pseudoatoms representing the possibility of closing a ring: the so-called RingClosingAttrac...