21import static org.junit.jupiter.api.Assertions.assertEquals;
22import static org.junit.jupiter.api.Assertions.assertTrue;
25import java.util.ArrayList;
26import java.util.Arrays;
27import java.util.Collection;
28import java.util.Comparator;
29import java.util.HashMap;
30import java.util.HashSet;
32import java.util.Random;
34import java.util.function.BiFunction;
35import java.util.logging.Logger;
36import java.util.stream.Collectors;
37import java.util.stream.IntStream;
38import java.util.stream.Stream;
40import javax.vecmath.Point3d;
42import org.jgrapht.alg.util.Pair;
43import org.junit.jupiter.api.BeforeAll;
44import org.junit.jupiter.api.Test;
45import org.openscience.cdk.Atom;
46import org.openscience.cdk.DefaultChemObjectBuilder;
47import org.openscience.cdk.PseudoAtom;
48import org.openscience.cdk.interfaces.IAtom;
49import org.openscience.cdk.interfaces.IAtomContainer;
50import org.openscience.cdk.interfaces.IBond;
51import org.openscience.cdk.interfaces.IChemObjectBuilder;
52import org.openscience.cdk.layout.StructureDiagramGenerator;
53import org.openscience.cdk.silent.Bond;
54import org.openscience.cdk.silent.SilentChemObjectBuilder;
55import org.openscience.cdk.smiles.SmilesParser;
57import denoptim.exception.DENOPTIMException;
58import denoptim.fragspace.FragmentSpace;
59import denoptim.fragspace.FragmentSpaceParameters;
60import denoptim.graph.APClass;
61import denoptim.graph.AttachmentPoint;
62import denoptim.graph.DGraph;
63import denoptim.graph.Edge.BondType;
64import denoptim.graph.EmptyVertex;
65import denoptim.graph.Fragment;
66import denoptim.graph.GraphPattern;
67import denoptim.graph.Ring;
68import denoptim.graph.SymmetricVertexes;
69import denoptim.graph.Template;
70import denoptim.graph.Template.ContractLevel;
71import denoptim.graph.Vertex;
72import denoptim.graph.Vertex.BBType;
73import denoptim.graph.rings.RingClosingAttractor;
74import denoptim.graph.rings.RingClosureParameters;
75import denoptim.io.DenoptimIO;
76import denoptim.logging.Monitor;
77import denoptim.molecularmodeling.ThreeDimTreeBuilder;
78import denoptim.programs.RunTimeParameters.ParametersType;
79import denoptim.programs.denovo.GAParameters;
80import denoptim.utils.GraphUtils;
81import denoptim.utils.MoleculeUtils;
82import denoptim.utils.Randomizer;
94 IChemObjectBuilder
chemBuilder = DefaultChemObjectBuilder.getInstance();
95 private final Random
rng =
new Random();
118 assertEquals(1, subgraphs.size());
119 DGraph actual = subgraphs.get(0);
140 assertEquals(0, subgraphs.size());
180 BiFunction<String, Boolean, Vertex> vertexSupplier =
201 List<Vertex> vertices = Stream.of(
202 new Pair<>(
"O",
true),
new Pair<>(
"C",
false),
203 new Pair<>(
"Cl",
false),
new Pair<>(
"N",
false),
204 new Pair<>(
"C",
true),
new Pair<>(
"N",
true),
205 new Pair<>(
"C",
true),
new Pair<>(
"O",
false),
206 new Pair<>(
"C",
false),
new Pair<>(
"O",
true),
207 new Pair<>(
"C",
true),
new Pair<>(
"C",
false),
208 new Pair<>(
"N",
true)
209 ).map(p -> vertexSupplier.apply(p.getFirst(), p.getSecond()))
210 .collect(Collectors.toList());
214 List<List<Integer>> edges = Arrays.asList(
216 Arrays.asList(2, 3, 4),
223 Arrays.asList(9, 10),
247 List<List<Integer>> edges)
251 for (
int i = 0; i < edges.size(); i++) {
252 Vertex srcVertex = vertices.get(i);
253 for (Integer adj : edges.get(i)) {
254 Vertex trgVertex = vertices.get(adj);
259 .filter(ap -> ap.getEdgeUser() ==
null)
265 .filter(ap -> ap.getEdgeUser() ==
null)
283 List<List<Vertex>> ringVertices = Stream.of(
284 Arrays.asList(0, 1, 3, 5),
285 Arrays.asList(4, 1, 3, 6),
286 Arrays.asList(6, 3, 5),
287 Arrays.asList(9, 8, 10),
288 Arrays.asList(10, 11, 12))
289 .map(indices -> indices
292 .collect(Collectors.toList())
294 .collect(Collectors.toList());
296 for (List<Vertex> vs : ringVertices) {
308 List<Set<Integer>> keepVertices = Stream.of(
309 Stream.of(0, 1, 3, 4, 5, 6),
310 Stream.of(8, 9, 10, 11, 12))
311 .map(indices -> indices.collect(Collectors.toSet()))
312 .collect(Collectors.toList());
314 List<DGraph> expectedSubgraphs =
new ArrayList<>(2);
315 for (Set<Integer> keepVertex : keepVertices) {
318 Set<Vertex> removeVertices = IntStream
319 .range(0, vertices.size())
320 .filter(i -> !keepVertex.contains(i))
321 .mapToObj(vertices::get)
322 .collect(Collectors.toSet());
324 for (
Vertex removeVertex : removeVertices) {
327 expectedSubgraphs.add(expSubgraph);
330 return new HashSet<>(expectedSubgraphs);
340 IAtomContainer atomContainer =
chemBuilder.newAtomContainer();
342 oxygen.setSymbol(elementSymbol);
343 atomContainer.addAtom(oxygen);
348 for (
int i = 0; i < apCount; i++)
353 }
catch (Throwable t)
363 double precision = 10*10*10*10;
365 (
double) (Math.round(
rng.nextDouble() * precision)) / precision,
366 (
double) (Math.round(
rng.nextDouble() * precision)) / precision,
367 (
double) (Math.round(
rng.nextDouble() * precision)) / precision
383 new ArrayList<>(),
true);
385 new ArrayList<>(),
true);
387 List<EmptyVertex> vertices = Arrays.asList(v1, rcv1, rcv2);
401 Arrays.asList(rcv1, v1, rcv2)));
416 gA.sameAs(gB,
new StringBuilder()) ? 0 : -1;
437 unmatchedGraphs = unmatchedGraphs
440 .collect(Collectors.toSet());
447 return unmatchedGraphs.size() == 0;
466 String k =
"Uniquefier";
474 List<ContractLevel> contracts =
new ArrayList<ContractLevel>();
479 List<Integer> expectedNumberOfSites =
new ArrayList<Integer>();
480 expectedNumberOfSites.add(17);
481 expectedNumberOfSites.add(12);
482 expectedNumberOfSites.add(10);
484 List<Set<String>> expectedInvariants =
new ArrayList<Set<String>>();
486 Set<String> invariantFREEContract =
new HashSet<String>();
487 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)+
"_");
504 expectedInvariants.add(invariantFREEContract);
505 Set<String> invariantFIXED_STRUCTContract =
new HashSet<String>();
506 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)+
"_");
518 expectedInvariants.add(invariantFIXED_STRUCTContract);
519 Set<String> invariantFIXEDContract =
new HashSet<String>();
520 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)+
"_");
530 expectedInvariants.add(invariantFIXEDContract);
532 for (
int i=0; i<contracts.size(); i++)
537 List<XoverSite> xoverSites =
541 assertEquals(expectedNumberOfSites.get(i), xoverSites.size());
549 boolean writeCode =
false;
552 String varName =
"invariant" + contracts.get(i) +
"Contract";
553 System.out.println(
"Set<String> " + varName +
" = new HashSet<String>();");
560 if (v.getGraphOwner()==graphA)
562 else if (v.getGraphOwner()==graphB)
565 g =
"t1.getInnerGraph()";
567 g =
"t2.getInnerGraph()";
571 s = s +
"+GraphUtils.getLabel("+g+
","+v.getGraphOwner().
indexOf(v)+
")+\"_\"";
577 if (v.getGraphOwner()==graphA)
579 else if (v.getGraphOwner()==graphB)
582 g =
"t1.getInnerGraph()";
584 g =
"t2.getInnerGraph()";
588 s = s +
"+GraphUtils.getLabel("+g+
","+v.getGraphOwner().
indexOf(v)+
")+\"_\"";
590 System.out.println(varName +
".add("+s+
");");
592 System.out.println(
"expectedInvariants.add("+varName+
");");
598 for (
Vertex v : site.getA())
601 v.getGraphOwner().indexOf(v)) +
"_";
603 label = label +
"@@@_";
604 for (
Vertex v : site.getB())
607 v.getGraphOwner().indexOf(v)) +
"_";
609 assertTrue(expectedInvariants.get(i).contains(label),
610 "For contract " + i +
" (" + contracts.get(i)
611 +
") - Missing label: "+label);
833 HashMap<APClass,ArrayList<APClass>> cpMap =
834 new HashMap<APClass,ArrayList<APClass>>();
835 ArrayList<APClass> lstA =
new ArrayList<APClass>();
837 cpMap.put(
APCA, lstA);
838 ArrayList<APClass> lstB =
new ArrayList<APClass>();
841 cpMap.put(
APCB, lstB);
842 ArrayList<APClass> lstC =
new ArrayList<APClass>();
844 cpMap.put(
APCC, lstC);
845 ArrayList<APClass> lstD =
new ArrayList<APClass>();
847 cpMap.put(
APCD, lstD);
849 HashMap<APClass,APClass> capMap =
new HashMap<APClass,APClass>();
850 HashSet<APClass> forbEnds =
new HashSet<APClass>();
854 new ArrayList<Vertex>(),
855 new ArrayList<Vertex>(),
856 new ArrayList<Vertex>(),
857 cpMap, capMap, forbEnds, cpMap);
879 IAtomContainer iacO =
chemBuilder.newAtomContainer();
880 IAtom aO =
new Atom(
"O",
new Point3d(0,0,0));
883 vO.
addAP(0,
new Point3d(0,-1,0), apc);
884 vO.
addAP(0,
new Point3d(2,0,0), apc);
885 vO.
addAP(0,
new Point3d(0,1,0), apc);
887 IAtomContainer iacC =
chemBuilder.newAtomContainer();
888 IAtom aC =
new Atom(
"C",
new Point3d(0,0,0));
891 vC.
addAP(0,
new Point3d(0,-1,0), apc);
892 vC.
addAP(0,
new Point3d(2,0,0), apc);
893 vC.
addAP(0,
new Point3d(0,1,0), apc);
895 IAtomContainer iacCd =
chemBuilder.newAtomContainer();
896 IAtom aCd =
new Atom(
"C",
new Point3d(0,0,0));
899 vC2.
addAP(0,
new Point3d(0,-1,0), apc);
900 vC2.
addAP(0,
new Point3d(0,1,0), apc);
911 IAtomContainer iacN =
chemBuilder.newAtomContainer();
912 IAtom aN =
new Atom(
"N",
new Point3d(0,0,0));
915 vN.
addAP(0,
new Point3d(0,-1,0), apc);
916 vN.
addAP(0,
new Point3d(2,0,0), apc);
917 vN.
addAP(0,
new Point3d(0,1,0), apc);
921 IAtomContainer iacD =
chemBuilder.newAtomContainer();
923 new Point3d(0,0,0)));
925 rcvM.
addAP(0,
new Point3d(-1,0,0), atMinus);
933 IAtomContainer iacE =
chemBuilder.newAtomContainer();
935 new Point3d(0,0,0)));
937 rcvP.
addAP(0,
new Point3d(-1,0,0), atPlus);
956 HashMap<APClass,ArrayList<APClass>> cpMap =
957 new HashMap<APClass,ArrayList<APClass>>();
958 ArrayList<APClass> lstA =
new ArrayList<APClass>();
960 cpMap.put(apc, lstA);
963 new ArrayList<Vertex>(),
964 new ArrayList<Vertex>(),
965 new ArrayList<Vertex>(),
967 new HashMap<APClass,APClass>(),
968 new HashSet<APClass>(),
974 List<Integer> biases =
new ArrayList<Integer>();
1003 ArrayList<Vertex> libFrags =
new ArrayList<Vertex>();
1007 IAtom a4_0 =
new Atom(
"Si",
new Point3d());
1008 IAtom a4_1 =
new Atom(
"Si",
new Point3d());
1009 IAtom a4_2 =
new Atom(
"Si",
new Point3d());
1010 IAtom a4_3 =
new Atom(
"Si",
new Point3d());
1015 bridge4el.
addBond(
new Bond(a4_0, a4_1, IBond.Order.DOUBLE));
1016 bridge4el.
addBond(
new Bond(a4_1, a4_2, IBond.Order.SINGLE));
1017 bridge4el.
addBond(
new Bond(a4_2, a4_3, IBond.Order.DOUBLE));
1018 bridge4el.
addAP(0,
new Point3d(), APC4EL);
1019 bridge4el.
addAP(3,
new Point3d(), APC4EL);
1020 bridge4el.
addAP(0,
new Point3d(), apcA);
1021 bridge4el.
addAP(1,
new Point3d(), apcA);
1022 bridge4el.
addAP(2,
new Point3d(), apcA);
1023 bridge4el.
addAP(3,
new Point3d(), apcA);
1024 libFrags.add(bridge4el);
1027 IAtom a3_0 =
new Atom(
"Ge",
new Point3d());
1028 IAtom a3_1 =
new Atom(
"N",
new Point3d());
1029 IAtom a3_2 =
new Atom(
"Ge",
new Point3d());
1033 bridge4el3Atm.
addBond(
new Bond(a3_0, a3_1, IBond.Order.SINGLE));
1034 bridge4el3Atm.
addBond(
new Bond(a3_1, a3_2, IBond.Order.SINGLE));
1035 bridge4el3Atm.
addAP(0,
new Point3d(), APC4EL);
1036 bridge4el3Atm.
addAP(2,
new Point3d(), APC4EL);
1037 bridge4el3Atm.
addAP(0,
new Point3d(), apcA);
1038 bridge4el3Atm.
addAP(2,
new Point3d(), apcA);
1039 libFrags.add(bridge4el3Atm);
1043 IAtom a1_0 =
new Atom(
"N",
new Point3d());
1045 bridge1el.
addAP(0,
new Point3d(), APC1EL);
1046 bridge1el.
addAP(0,
new Point3d(), APC1EL);
1047 libFrags.add(bridge1el);
1049 HashMap<APClass,APClass> cappingRules =
new HashMap<APClass,APClass>();
1050 cappingRules.put(apcA, hyd);
1052 ArrayList<Vertex> cappingGroups =
new ArrayList<Vertex>();
1054 capH.
addAtom(
new Atom(
"H",
new Point3d()));
1055 capH.
addAP(0,
new Point3d(1.0, 0, 0), hyd);
1056 cappingGroups.add(capH);
1058 HashMap<APClass,ArrayList<APClass>> rcCpMap =
1059 new HashMap<APClass,ArrayList<APClass>>();
1060 rcCpMap.put(apcA,
new ArrayList<APClass>(Arrays.asList(APC4EL)));
1064 new ArrayList<Vertex>(),
1067 new HashMap<
APClass,ArrayList<APClass>>(),
1069 new HashSet<APClass>(),
1083 SmilesParser parser =
new SmilesParser(
chemBuilder);
1084 IAtomContainer benzene = parser.parseSmiles(
"c1ccccc1");
1086 StructureDiagramGenerator sdg =
new StructureDiagramGenerator();
1087 sdg.generateCoordinates(benzene);
1089 for (
int i= 0; i<6; i++)
1105 v.getIAtomContainer(),
"Si");
1107 assertEquals(12, numSiAtoms);
1113 IAtomContainer arom = parser.parseSmiles(
"c1cccc(c12)ccc(c23)ccc(c34)cccc4");
1115 sdg.generateCoordinates(arom);
1131 IAtomContainer arom2 = parser.parseSmiles(
"c1cccc(c12)ccc(c23)ccc(c34)cccc4");
1133 sdg.generateCoordinates(arom2);
1158 v.getIAtomContainer(),
"Si");
1160 v.getIAtomContainer(),
"N");
1162 v.getIAtomContainer(),
"Ge");
1164 assertEquals(0, numSiAtoms);
1165 assertEquals(1, numNAtoms);
1166 assertEquals(2, numGeAtoms);
1184 Atom ac1 =
new Atom(
"C",
new Point3d());
1186 vC1.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1187 vC1.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 0.0));
1188 vC1.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 2.0));
1189 vC1.
addAP(0,
APCB,
new Point3d(1.1,-1.0, 2.0));
1192 Atom ac31 =
new Atom(
"C",
new Point3d(0.0, 2.0, 0.0));
1193 Atom ac32 =
new Atom(
"C",
new Point3d(0.0, 0.0, 2.0));
1194 Atom ac33 =
new Atom(
"C",
new Point3d(0.0, 0.0, 0.0));
1198 vC3.
addBond(
new Bond(ac31, ac32));
1199 vC3.
addBond(
new Bond(ac32, ac33));
1200 vC3.
addBond(
new Bond(ac33, ac31));
1201 vC3.
addAP(0,
APCA,
new Point3d(0.0, 2.0, -1.0));
1202 vC3.
addAP(1,
APCA,
new Point3d(-1.0,-1.0, 3.0));
1203 vC3.
addAP(1,
APCA,
new Point3d(1.0, -1.0, 3.0));
1204 vC3.
addAP(2,
APCA,
new Point3d(-1.0,-1.0, 1.0));
1205 vC3.
addAP(2,
APCA,
new Point3d(1.0, -1.0, 1.0));
1208 Atom acl =
new Atom(
"Cl",
new Point3d());
1210 vCl.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1213 Atom aN =
new Atom(
"N",
new Point3d());
1215 vN.
addAP(0,
APCB,
new Point3d(1.1, 0.0, 0.0));
1216 vN.
addAP(0,
APCA,
new Point3d(1.1, 1.0, 0.0));
1217 vN.
addAP(0,
APCB,
new Point3d(1.1, 1.0, 2.0));
1219 ArrayList<Vertex> fragments =
new ArrayList<Vertex>();
1272 HashMap<APClass,ArrayList<APClass>> cpMap =
1273 new HashMap<APClass,ArrayList<APClass>>();
1274 ArrayList<APClass> lstA =
new ArrayList<APClass>();
1276 cpMap.put(
APCA, lstA);
1277 ArrayList<APClass> lstB =
new ArrayList<APClass>();
1279 cpMap.put(
APCB, lstB);
1283 new ArrayList<Vertex>(),
1285 new ArrayList<Vertex>(),
1287 new HashMap<APClass,APClass>(),
1288 new HashSet<APClass>(),
1289 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)
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()
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 DENOPTIMVertex 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.