20package denoptim.utils;
22import java.util.concurrent.atomic.AtomicInteger;
23import java.util.concurrent.atomic.AtomicLong;
25import org.openscience.cdk.interfaces.IAtomContainer;
27import denoptim.constants.DENOPTIMConstants;
28import denoptim.exception.DENOPTIMException;
29import denoptim.graph.DGraph;
30import denoptim.graph.Vertex;
43 private static AtomicInteger
molCounter =
new AtomicInteger(1);
82 String msg =
"Attempt to reset the unique vertex ID using "
83 + l +
" while the current value is "
100 throw new Error(
"Reached maximum value for "
101 +
"Vertex identifier. It is highly likely that you should "
102 +
"not be in this situation as it means you have generated "
103 +
"too many vertices. Contact the authors is you really "
104 +
"think you need vertex identifiers bigger than 2^64.");
126 String msg =
"Attempt to reset the unique graph ID using "
127 + val +
" while the current value is "
145 throw new Error(
"Reached maximum value for "
146 +
"Graph identifier. Please contact the authors to "
147 +
"request use of 'long' IDs.");
169 String msg =
"Attempt to reser the unique mol ID using "
170 + val +
" while the current value is "
187 throw new Error(
"Reached maximum value for "
188 +
"Molecule identifier. Please contact the authors to "
189 +
"request use of 'long' IDs.");
201 if (g.getLocalMsg() !=
null
202 && !g.getLocalMsg().toString().equals(
""))
General set of constants used in DENOPTIM.
static final String GRAPHTAG
SDF tag containing graph encoding.
static final String PROVENANCE
SDF tag containing provenance data for a graph.
static final String GCODETAG
SDF tag containing graph ID.
static final String GRAPHJSONTAG
SDF tag containing graph encoding in JSON format.
Container for the list of vertices and the edges that connect them.
Vertex getVertexAtPosition(int pos)
Returns the vertex that is in the given position of the list of vertices belonging to this graph.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
DGraph getGraphOwner()
Returns the graph this vertex belongs to or null.
Object getProperty(Object property)
boolean hasProperty(Object property)
static AtomicLong vertexCounter
static synchronized void resetUniqueGraphCounter(int val)
Reset the unique graph counter to the given value.
static AtomicInteger molCounter
static synchronized void ensureVertexIDConsistency(long l)
Method used to ensure consistency between internal atomic integer and vertex id from imported graphs.
static synchronized long getUniqueVertexIndex()
Unique counter for the number of graph vertices generated.
static String getLabel(Vertex v)
static void writeSDFFields(IAtomContainer iac, DGraph g)
static synchronized void resetUniqueMoleculeCounter(int val)
Reset the unique mol counter to the given value.
static synchronized int getUniqueMoleculeIndex()
Unique counter for the number of molecules generated.
static synchronized void resetUniqueVertexCounter(long l)
Reset the unique vertex counter to the given value.
static String getLabel(DGraph g, int vIdx)
static synchronized int getUniqueGraphIndex()
Unique counter for the number of graphs generated.
static AtomicInteger graphCounter