21import static org.junit.jupiter.api.Assertions.assertEquals;
22import static org.junit.jupiter.api.Assertions.assertTrue;
24import java.util.ArrayList;
25import java.util.Arrays;
26import java.util.Collection;
27import java.util.Comparator;
28import java.util.HashMap;
29import java.util.HashSet;
31import java.util.Random;
33import java.util.function.BiFunction;
34import java.util.stream.Collectors;
35import java.util.stream.IntStream;
36import java.util.stream.Stream;
38import javax.vecmath.Point3d;
40import org.jgrapht.alg.util.Pair;
41import org.junit.jupiter.api.BeforeAll;
42import org.junit.jupiter.api.Test;
43import org.openscience.cdk.Atom;
44import org.openscience.cdk.DefaultChemObjectBuilder;
45import org.openscience.cdk.PseudoAtom;
46import org.openscience.cdk.interfaces.IAtom;
47import org.openscience.cdk.interfaces.IAtomContainer;
48import org.openscience.cdk.interfaces.IBond;
49import org.openscience.cdk.interfaces.IChemObjectBuilder;
50import org.openscience.cdk.layout.StructureDiagramGenerator;
51import org.openscience.cdk.silent.Bond;
52import org.openscience.cdk.smiles.SmilesParser;
54import denoptim.exception.DENOPTIMException;
55import denoptim.fragspace.FragmentSpace;
56import denoptim.fragspace.FragmentSpaceParameters;
57import denoptim.graph.APClass;
58import denoptim.graph.AttachmentPoint;
59import denoptim.graph.DGraph;
60import denoptim.graph.EmptyVertex;
61import denoptim.graph.Fragment;
62import denoptim.graph.GraphPattern;
63import denoptim.graph.Ring;
64import denoptim.graph.SymmetricVertexes;
65import denoptim.graph.Template;
66import denoptim.graph.Template.ContractLevel;
67import denoptim.graph.Vertex;
68import denoptim.graph.Vertex.BBType;
69import denoptim.graph.rings.RingClosingAttractor;
70import denoptim.graph.rings.RingClosureParameters;
71import denoptim.logging.Monitor;
72import denoptim.programs.RunTimeParameters.ParametersType;
73import denoptim.programs.denovo.GAParameters;
74import denoptim.utils.GraphUtils;
75import denoptim.utils.MoleculeUtils;
76import denoptim.utils.Randomizer;
88 IChemObjectBuilder
chemBuilder = DefaultChemObjectBuilder.getInstance();
89 private final Random
rng =
new Random();
112 assertEquals(1, subgraphs.size());
113 DGraph actual = subgraphs.get(0);
134 assertEquals(0, subgraphs.size());
174 BiFunction<String, Boolean, Vertex> vertexSupplier =
195 List<Vertex> vertices = Stream.of(
196 new Pair<>(
"O",
true),
new Pair<>(
"C",
false),
197 new Pair<>(
"Cl",
false),
new Pair<>(
"N",
false),
198 new Pair<>(
"C",
true),
new Pair<>(
"N",
true),
199 new Pair<>(
"C",
true),
new Pair<>(
"O",
false),
200 new Pair<>(
"C",
false),
new Pair<>(
"O",
true),
201 new Pair<>(
"C",
true),
new Pair<>(
"C",
false),
202 new Pair<>(
"N",
true)
203 ).map(p -> vertexSupplier.apply(p.getFirst(), p.getSecond()))
204 .collect(Collectors.toList());
208 List<List<Integer>> edges = Arrays.asList(
210 Arrays.asList(2, 3, 4),
217 Arrays.asList(9, 10),
241 List<List<Integer>> edges)
245 for (
int i = 0; i < edges.size(); i++) {
246 Vertex srcVertex = vertices.get(i);
247 for (Integer adj : edges.get(i)) {
248 Vertex trgVertex = vertices.get(adj);
253 .filter(ap -> ap.getEdgeUser() ==
null)
259 .filter(ap -> ap.getEdgeUser() ==
null)
277 List<List<Vertex>> ringVertices = Stream.of(
278 Arrays.asList(0, 1, 3, 5),
279 Arrays.asList(4, 1, 3, 6),
280 Arrays.asList(6, 3, 5),
281 Arrays.asList(9, 8, 10),
282 Arrays.asList(10, 11, 12))
283 .map(indices -> indices
286 .collect(Collectors.toList())
288 .collect(Collectors.toList());
290 for (List<Vertex> vs : ringVertices) {
302 List<Set<Integer>> keepVertices = Stream.of(
303 Stream.of(0, 1, 3, 4, 5, 6),
304 Stream.of(8, 9, 10, 11, 12))
305 .map(indices -> indices.collect(Collectors.toSet()))
306 .collect(Collectors.toList());
308 List<DGraph> expectedSubgraphs =
new ArrayList<>(2);
309 for (Set<Integer> keepVertex : keepVertices) {
312 Set<Vertex> removeVertices = IntStream
313 .range(0, vertices.size())
314 .filter(i -> !keepVertex.contains(i))
315 .mapToObj(vertices::get)
316 .collect(Collectors.toSet());
318 for (
Vertex removeVertex : removeVertices) {
321 expectedSubgraphs.add(expSubgraph);
324 return new HashSet<>(expectedSubgraphs);
334 IAtomContainer atomContainer =
chemBuilder.newAtomContainer();
336 oxygen.setSymbol(elementSymbol);
337 atomContainer.addAtom(oxygen);
342 for (
int i = 0; i < apCount; i++)
347 }
catch (Throwable t)
357 double precision = 10*10*10*10;
359 (
double) (Math.round(
rng.nextDouble() * precision)) / precision,
360 (
double) (Math.round(
rng.nextDouble() * precision)) / precision,
361 (
double) (Math.round(
rng.nextDouble() * precision)) / precision
377 new ArrayList<>(),
true);
379 new ArrayList<>(),
true);
381 List<EmptyVertex> vertices = Arrays.asList(v1, rcv1, rcv2);
395 Arrays.asList(rcv1, v1, rcv2)));
410 gA.sameAs(gB,
new StringBuilder()) ? 0 : -1;
431 unmatchedGraphs = unmatchedGraphs
434 .collect(Collectors.toSet());
441 return unmatchedGraphs.size() == 0;
460 String k =
"Uniquefier";
468 List<ContractLevel> contracts =
new ArrayList<ContractLevel>();
473 List<Integer> expectedNumberOfSites =
new ArrayList<Integer>();
474 expectedNumberOfSites.add(17);
475 expectedNumberOfSites.add(12);
476 expectedNumberOfSites.add(10);
478 List<Set<String>> expectedInvariants =
new ArrayList<Set<String>>();
480 Set<String> invariantFREEContract =
new HashSet<String>();
481 invariantFREEContract.add(
""+
GraphUtils.
getLabel(graphA,1)+
"_"+
GraphUtils.
getLabel(graphA,4)+
"_"+
GraphUtils.
getLabel(graphA,2)+
"_"+
GraphUtils.
getLabel(graphA,3)+
"_"+
GraphUtils.
getLabel(graphA,5)+
"_"+
"@@@_"+
GraphUtils.
getLabel(graphB,1)+
"_"+
GraphUtils.
getLabel(graphB,5)+
"_"+
GraphUtils.
getLabel(graphB,2)+
"_"+
GraphUtils.
getLabel(graphB,3)+
"_"+
GraphUtils.
getLabel(graphB,4)+
"_");
498 expectedInvariants.add(invariantFREEContract);
499 Set<String> invariantFIXED_STRUCTContract =
new HashSet<String>();
500 invariantFIXED_STRUCTContract.add(
""+
GraphUtils.
getLabel(graphA,1)+
"_"+
GraphUtils.
getLabel(graphA,4)+
"_"+
GraphUtils.
getLabel(graphA,2)+
"_"+
GraphUtils.
getLabel(graphA,3)+
"_"+
GraphUtils.
getLabel(graphA,5)+
"_"+
"@@@_"+
GraphUtils.
getLabel(graphB,1)+
"_"+
GraphUtils.
getLabel(graphB,5)+
"_"+
GraphUtils.
getLabel(graphB,2)+
"_"+
GraphUtils.
getLabel(graphB,3)+
"_"+
GraphUtils.
getLabel(graphB,4)+
"_");
512 expectedInvariants.add(invariantFIXED_STRUCTContract);
513 Set<String> invariantFIXEDContract =
new HashSet<String>();
514 invariantFIXEDContract.add(
""+
GraphUtils.
getLabel(graphA,1)+
"_"+
GraphUtils.
getLabel(graphA,4)+
"_"+
GraphUtils.
getLabel(graphA,2)+
"_"+
GraphUtils.
getLabel(graphA,3)+
"_"+
GraphUtils.
getLabel(graphA,5)+
"_"+
"@@@_"+
GraphUtils.
getLabel(graphB,1)+
"_"+
GraphUtils.
getLabel(graphB,5)+
"_"+
GraphUtils.
getLabel(graphB,2)+
"_"+
GraphUtils.
getLabel(graphB,3)+
"_"+
GraphUtils.
getLabel(graphB,4)+
"_");
524 expectedInvariants.add(invariantFIXEDContract);
526 for (
int i=0; i<contracts.size(); i++)
531 List<XoverSite> xoverSites =
536 assertEquals(expectedNumberOfSites.get(i), xoverSites.size());
544 boolean writeCode =
false;
547 String varName =
"invariant" + contracts.get(i) +
"Contract";
548 System.out.println(
"Set<String> " + varName +
" = new HashSet<String>();");
555 if (v.getGraphOwner()==graphA)
557 else if (v.getGraphOwner()==graphB)
560 g =
"t1.getInnerGraph()";
562 g =
"t2.getInnerGraph()";
566 s = s +
"+GraphUtils.getLabel("+g+
","+v.getGraphOwner().
indexOf(v)+
")+\"_\"";
572 if (v.getGraphOwner()==graphA)
574 else if (v.getGraphOwner()==graphB)
577 g =
"t1.getInnerGraph()";
579 g =
"t2.getInnerGraph()";
583 s = s +
"+GraphUtils.getLabel("+g+
","+v.getGraphOwner().
indexOf(v)+
")+\"_\"";
585 System.out.println(varName +
".add("+s+
");");
587 System.out.println(
"expectedInvariants.add("+varName+
");");
593 for (
Vertex v : site.getA())
596 v.getGraphOwner().indexOf(v)) +
"_";
598 label = label +
"@@@_";
599 for (
Vertex v : site.getB())
602 v.getGraphOwner().indexOf(v)) +
"_";
604 assertTrue(expectedInvariants.get(i).contains(label),
605 "For contract " + i +
" (" + contracts.get(i)
606 +
") - Missing label: "+label);
828 HashMap<APClass,ArrayList<APClass>> cpMap =
829 new HashMap<APClass,ArrayList<APClass>>();
830 ArrayList<APClass> lstA =
new ArrayList<APClass>();
832 cpMap.put(
APCA, lstA);
833 ArrayList<APClass> lstB =
new ArrayList<APClass>();
836 cpMap.put(
APCB, lstB);
837 ArrayList<APClass> lstC =
new ArrayList<APClass>();
839 cpMap.put(
APCC, lstC);
840 ArrayList<APClass> lstD =
new ArrayList<APClass>();
842 cpMap.put(
APCD, lstD);
844 HashMap<APClass,APClass> capMap =
new HashMap<APClass,APClass>();
845 HashSet<APClass> forbEnds =
new HashSet<APClass>();
849 new ArrayList<Vertex>(),
850 new ArrayList<Vertex>(),
851 new ArrayList<Vertex>(),
852 cpMap, capMap, forbEnds, cpMap);
874 IAtomContainer iacO =
chemBuilder.newAtomContainer();
875 IAtom aO =
new Atom(
"O",
new Point3d(0,0,0));
878 vO.
addAP(0,
new Point3d(0,-1,0), apc);
879 vO.
addAP(0,
new Point3d(2,0,0), apc);
880 vO.
addAP(0,
new Point3d(0,1,0), apc);
882 IAtomContainer iacC =
chemBuilder.newAtomContainer();
883 IAtom aC =
new Atom(
"C",
new Point3d(0,0,0));
886 vC.
addAP(0,
new Point3d(0,-1,0), apc);
887 vC.
addAP(0,
new Point3d(2,0,0), apc);
888 vC.
addAP(0,
new Point3d(0,1,0), apc);
890 IAtomContainer iacCd =
chemBuilder.newAtomContainer();
891 IAtom aCd =
new Atom(
"C",
new Point3d(0,0,0));
894 vC2.
addAP(0,
new Point3d(0,-1,0), apc);
895 vC2.
addAP(0,
new Point3d(0,1,0), apc);
906 IAtomContainer iacN =
chemBuilder.newAtomContainer();
907 IAtom aN =
new Atom(
"N",
new Point3d(0,0,0));
910 vN.
addAP(0,
new Point3d(0,-1,0), apc);
911 vN.
addAP(0,
new Point3d(2,0,0), apc);
912 vN.
addAP(0,
new Point3d(0,1,0), apc);
916 IAtomContainer iacD =
chemBuilder.newAtomContainer();
918 new Point3d(0,0,0)));
920 rcvM.
addAP(0,
new Point3d(-1,0,0), atMinus);
928 IAtomContainer iacE =
chemBuilder.newAtomContainer();
930 new Point3d(0,0,0)));
932 rcvP.
addAP(0,
new Point3d(-1,0,0), atPlus);
951 HashMap<APClass,ArrayList<APClass>> cpMap =
952 new HashMap<APClass,ArrayList<APClass>>();
953 ArrayList<APClass> lstA =
new ArrayList<APClass>();
955 cpMap.put(apc, lstA);
958 new ArrayList<Vertex>(),
959 new ArrayList<Vertex>(),
960 new ArrayList<Vertex>(),
962 new HashMap<APClass,APClass>(),
963 new HashSet<APClass>(),
969 List<Integer> biases =
new ArrayList<Integer>();
998 ArrayList<Vertex> libFrags =
new ArrayList<Vertex>();
1002 IAtom a4_0 =
new Atom(
"Si",
new Point3d());
1003 IAtom a4_1 =
new Atom(
"Si",
new Point3d());
1004 IAtom a4_2 =
new Atom(
"Si",
new Point3d());
1005 IAtom a4_3 =
new Atom(
"Si",
new Point3d());
1010 bridge4el.
addBond(
new Bond(a4_0, a4_1, IBond.Order.DOUBLE));
1011 bridge4el.
addBond(
new Bond(a4_1, a4_2, IBond.Order.SINGLE));
1012 bridge4el.
addBond(
new Bond(a4_2, a4_3, IBond.Order.DOUBLE));
1013 bridge4el.
addAP(0,
new Point3d(), APC4EL);
1014 bridge4el.
addAP(3,
new Point3d(), APC4EL);
1015 bridge4el.
addAP(0,
new Point3d(), apcA);
1016 bridge4el.
addAP(1,
new Point3d(), apcA);
1017 bridge4el.
addAP(2,
new Point3d(), apcA);
1018 bridge4el.
addAP(3,
new Point3d(), apcA);
1019 libFrags.add(bridge4el);
1022 IAtom a3_0 =
new Atom(
"Ge",
new Point3d());
1023 IAtom a3_1 =
new Atom(
"N",
new Point3d());
1024 IAtom a3_2 =
new Atom(
"Ge",
new Point3d());
1028 bridge4el3Atm.
addBond(
new Bond(a3_0, a3_1, IBond.Order.SINGLE));
1029 bridge4el3Atm.
addBond(
new Bond(a3_1, a3_2, IBond.Order.SINGLE));
1030 bridge4el3Atm.
addAP(0,
new Point3d(), APC4EL);
1031 bridge4el3Atm.
addAP(2,
new Point3d(), APC4EL);
1032 bridge4el3Atm.
addAP(0,
new Point3d(), apcA);
1033 bridge4el3Atm.
addAP(2,
new Point3d(), apcA);
1034 libFrags.add(bridge4el3Atm);
1038 IAtom a1_0 =
new Atom(
"N",
new Point3d());
1040 bridge1el.
addAP(0,
new Point3d(), APC1EL);
1041 bridge1el.
addAP(0,
new Point3d(), APC1EL);
1042 libFrags.add(bridge1el);
1044 HashMap<APClass,APClass> cappingRules =
new HashMap<APClass,APClass>();
1045 cappingRules.put(apcA, hyd);
1047 ArrayList<Vertex> cappingGroups =
new ArrayList<Vertex>();
1049 capH.
addAtom(
new Atom(
"H",
new Point3d()));
1050 capH.
addAP(0,
new Point3d(1.0, 0, 0), hyd);
1051 cappingGroups.add(capH);
1053 HashMap<APClass,ArrayList<APClass>> rcCpMap =
1054 new HashMap<APClass,ArrayList<APClass>>();
1055 rcCpMap.put(apcA,
new ArrayList<APClass>(Arrays.asList(APC4EL)));
1059 new ArrayList<Vertex>(),
1062 new HashMap<
APClass,ArrayList<APClass>>(),
1064 new HashSet<APClass>(),
1078 SmilesParser parser =
new SmilesParser(
chemBuilder);
1079 IAtomContainer benzene = parser.parseSmiles(
"c1ccccc1");
1081 StructureDiagramGenerator sdg =
new StructureDiagramGenerator();
1082 sdg.generateCoordinates(benzene);
1084 for (
int i= 0; i<6; i++)
1100 v.getIAtomContainer(),
"Si");
1102 assertEquals(12, numSiAtoms);
1108 IAtomContainer arom = parser.parseSmiles(
"c1cccc(c12)ccc(c23)ccc(c34)cccc4");
1110 sdg.generateCoordinates(arom);
1126 IAtomContainer arom2 = parser.parseSmiles(
"c1cccc(c12)ccc(c23)ccc(c34)cccc4");
1128 sdg.generateCoordinates(arom2);
1153 v.getIAtomContainer(),
"Si");
1155 v.getIAtomContainer(),
"N");
1157 v.getIAtomContainer(),
"Ge");
1159 assertEquals(0, numSiAtoms);
1160 assertEquals(1, numNAtoms);
1161 assertEquals(2, numGeAtoms);
1179 Atom ac1 =
new Atom(
"C",
new Point3d());
1181 vC1.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1182 vC1.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 0.0));
1183 vC1.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 2.0));
1184 vC1.
addAP(0,
APCB,
new Point3d(1.1,-1.0, 2.0));
1187 Atom ac31 =
new Atom(
"C",
new Point3d(0.0, 2.0, 0.0));
1188 Atom ac32 =
new Atom(
"C",
new Point3d(0.0, 0.0, 2.0));
1189 Atom ac33 =
new Atom(
"C",
new Point3d(0.0, 0.0, 0.0));
1193 vC3.
addBond(
new Bond(ac31, ac32));
1194 vC3.
addBond(
new Bond(ac32, ac33));
1195 vC3.
addBond(
new Bond(ac33, ac31));
1196 vC3.
addAP(0,
APCA,
new Point3d(0.0, 2.0, -1.0));
1197 vC3.
addAP(1,
APCA,
new Point3d(-1.0,-1.0, 3.0));
1198 vC3.
addAP(1,
APCA,
new Point3d(1.0, -1.0, 3.0));
1199 vC3.
addAP(2,
APCA,
new Point3d(-1.0,-1.0, 1.0));
1200 vC3.
addAP(2,
APCA,
new Point3d(1.0, -1.0, 1.0));
1203 Atom acl =
new Atom(
"Cl",
new Point3d());
1205 vCl.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1208 Atom aN =
new Atom(
"N",
new Point3d());
1210 vN.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1211 vN.
addAP(0,
APCA,
new Point3d(1.1, 1.0, 0.0));
1212 vN.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 2.0));
1214 ArrayList<Vertex> fragments =
new ArrayList<Vertex>();
1267 HashMap<APClass,ArrayList<APClass>> cpMap =
1268 new HashMap<APClass,ArrayList<APClass>>();
1269 ArrayList<APClass> lstA =
new ArrayList<APClass>();
1271 cpMap.put(
APCA, lstA);
1272 ArrayList<APClass> lstB =
new ArrayList<APClass>();
1274 cpMap.put(
APCB, lstB);
1278 new ArrayList<Vertex>(),
1280 new ArrayList<Vertex>(),
1282 new HashMap<APClass,APClass>(),
1283 new HashSet<APClass>(),
1284 new HashMap<
APClass,ArrayList<APClass>>());
Class defining a space of building blocks.
void setAPclassBasedApproach(boolean useAPC)
Set the fragment space to behave according to APClass-based approach.
Parameters defining the fragment space.
static void replaceHatomWithAP(Fragment frag, int srcId, APClass apc)
Collection of operators meant to alter graphs and associated utilities.
static List< XoverSite > locateCompatibleXOverPoints(DGraph graphA, DGraph graphB, FragmentSpace fragSpace, int maxSizeXoverSubGraph, int maxCompatibleVrtxPairs, int maxEndPointsCombinations, int maxEndPointsPermutations, int maxAPMappingCombinations)
Identify crossover sites, i.e., subgraphs that can be swapped between two graphs (i....
static boolean extendGraph(Vertex curVertex, boolean extend, boolean symmetryOnAps, GAParameters settings)
function that will keep extending the graph according to the growth/substitution probability.
static boolean addFusedRing(Vertex vertex, Monitor mnt, boolean force, FragmentSpace fragSpace, GAParameters settings)
Tries to add a fused ring using a pair of free APs, one of which on the given vertex.
static boolean addRing(Vertex vertex, Monitor mnt, boolean force, FragmentSpace fragSpace, GAParameters settings)
Tries to use any free AP of the given vertex to close ring in the graph by adding a chord.
DGraph[] getPairOfTestGraphs()
Generates a pair of graphs that include templates with free content.
void testExtractPattern_singleRingSystem()
IChemObjectBuilder chemBuilder
Set< DGraph > getExpectedSubgraphs(DGraph graph)
Vertex buildFragment(String elementSymbol, int apCount, boolean isRCV)
void testExtractPattern_returnsEmptyListIfNoRings()
void testExtractPattern_fusedRings()
Point3d getRandomVector()
FragmentSpace prepare()
Sets the compatibility matrix (src -> trg);.
void testLocateCompatibleXOverPoints()
void addRings(List< Vertex > vertices, DGraph g)
DGraph getThreeCycle()
Returns a 3-cycle.
static APClass DEFAULT_APCLASS
DGraph buildGraph(List< Vertex > vertices, List< List< Integer > > edges)
ExtractPatternCase getFusedRings()
Returns a molecule consisting of two pairs of fused rings connected by an oxygen atom.
This class collects the data identifying the subgraphs that would be swapped by a crossover event.
static final APClass RCACLASSPLUS
Conventional class of attachment points on ring-closing vertexes.
static final APClass RCACLASSMINUS
Conventional class of attachment points on ring-closing vertexes.
static APClass make(String ruleAndSubclass)
Creates an APClass if it does not exist already, or returns the reference to the existing instance.
An attachment point (AP) is a possibility to attach a Vertex onto the vertex holding the AP (i....
Container for the list of vertices and the edges that connect them.
int getSymmetricSetCount()
Returns the number of symmetric sets of vertices.
Vertex getSourceVertex()
Identifies and return the vertex from which the spanning tree originates.
void removeRing(Ring ring)
void addVertex(Vertex vertex)
Appends a vertex to this graph without creating any edge.
void removeVertex(Vertex vertex)
Remove a vertex from this graph.
int indexOf(Vertex v)
Returns the index of a vertex in the list of vertices of this graph.
Vertex getVertexAtPosition(int pos)
Returns the vertex that is in the given position of the list of vertices belonging to this graph.
static void setScaffold(Vertex v)
Update the graph so that the vertex argument is at the scaffold level i.e.
void appendVertexOnAP(AttachmentPoint srcAP, AttachmentPoint trgAP)
Append a vertex to this graph: adds the new vertex to the list of vertices belonging to the graph,...
List< Vertex > getVertexList()
Returns the list of vertexes without entering Templates.
static boolean compareGraphNodes(Vertex thisV, DGraph thisG, Vertex otherV, DGraph otherG)
Compares graphs by spanning vertices starting from the given vertex and following the direction of ed...
DGraph clone()
Returns almost "deep-copy" of this graph.
List< DGraph > extractPattern(GraphPattern pattern)
Extracts subgraphs that match the provided pattern.
void renumberGraphVertices()
Reassign vertex IDs to all vertices of this graph.
List< Vertex > getSymVerticesForVertex(Vertex v)
void addSymmetricSetOfVertices(SymmetricVertexes symSet)
Adds a symmetric set of vertices to this graph.
An empty vertex has the behaviors of a vertex, but has no molecular structure.
void addAP()
Adds an attachment point with no APClass or other attribute.
Class representing a continuously connected portion of chemical object holding attachment points.
void addAP(int atomPositionNumber)
Adds an attachment point with a dummy APClass.
Fragment clone()
Returns a deep copy of this fragments.
This class represents the closure of a ring in a spanning tree.
void addVertex(Vertex v)
Append a Vertex to the list.
A collection of Vertexs that are related by a relation that we call "symmetry", even though this clas...
void setInnerGraph(DGraph innerGraph)
void setContractLevel(ContractLevel contract)
Imposes the given contract to this template.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
void setVertexId(long vertexId2)
void setAsRCV(boolean isRCV)
abstract List< AttachmentPoint > getAttachmentPoints()
void setUniquefyingProperty(String key)
Add the given key among the properties that are checked for equality when comparing vertices with the...
void setProperty(Object key, Object property)
AttachmentPoint getAP(int i)
Get attachment point i on this vertex.
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
static final HashMap< APClass, String > RCALABELPERAPCLASS
Conventional labels for attractor pseudoatom.
Parameters and setting related to handling ring closures.
void setRingSizeBias(List< Integer > biases)
Sets the preference for certain ring sizes or the prohibition to generate certain rings (i....
A collection of counters user to count actions taken by the evolutionary algorithm.
void setRandomizer(Randomizer rng)
Sets the randomizer.
void setParameters(RunTimeParameters otherParams)
RunTimeParameters getParameters(ParametersType type)
Parameters for genetic algorithm.
static synchronized long getUniqueVertexIndex()
Unique counter for the number of graph vertices generated.
static String getLabel(Vertex v)
Utilities for molecule conversion.
static int countAtomsOfElement(IAtomContainer mol, String symbol)
Count atoms with the given elemental symbol.
static void explicitHydrogens(IAtomContainer mol)
Converts all the implicit hydrogens to explicit.
Tool to generate random numbers and random decisions.
Enum specifying to what extent the template's inner graph can be changed.
FREE
Inner graphs are free to change within the confines of the required AttachmentPoints.
FIXED
Inner graphs are effectively equivalent to the Fragment class, as no change in the inner structure is...
FIXED_STRUCT
Inner graph keep the same structure, but the identify of vertices can change.
The type of building block.
Identifier of the type of parameters.
RC_PARAMS
Parameters pertaining to ring closures in graphs.