$darkmode
DENOPTIM
denoptim.utils.GraphUtils Class Reference

Utilities for graphs. More...

Collaboration diagram for denoptim.utils.GraphUtils:
[legend]

Static Public Member Functions

static synchronized void ensureVertexIDConsistency (long l) throws DENOPTIMException
 Method used to ensure consistency between internal atomic integer and vertex id from imported graphs. More...
 
static synchronized void resetUniqueVertexCounter (long l) throws DENOPTIMException
 Reset the unique vertex counter to the given value. More...
 
static synchronized long getUniqueVertexIndex ()
 Unique counter for the number of graph vertices generated. More...
 
static synchronized void resetUniqueGraphCounter (int val) throws DENOPTIMException
 Reset the unique graph counter to the given value. More...
 
static synchronized int getUniqueGraphIndex ()
 Unique counter for the number of graphs generated. More...
 
static synchronized void resetUniqueMoleculeCounter (int val) throws DENOPTIMException
 Reset the unique mol counter to the given value. More...
 
static synchronized int getUniqueMoleculeIndex ()
 Unique counter for the number of molecules generated. More...
 
static void writeSDFFields (IAtomContainer iac, DGraph g) throws DENOPTIMException
 
static String getLabel (Vertex v)
 
static String getLabel (DGraph g, int vIdx)
 

Static Public Attributes

static AtomicLong vertexCounter = new AtomicLong(1)
 

Static Private Attributes

static AtomicInteger graphCounter = new AtomicInteger(1)
 
static AtomicInteger molCounter = new AtomicInteger(1)
 

Detailed Description

Utilities for graphs.

Author
Vishwesh Venkatraman
Marco Foscato

Definition at line 39 of file GraphUtils.java.

Member Function Documentation

◆ ensureVertexIDConsistency()

static synchronized void denoptim.utils.GraphUtils.ensureVertexIDConsistency ( long  l) throws DENOPTIMException
static

Method used to ensure consistency between internal atomic integer and vertex id from imported graphs.

The latter can be greater than the first, thus requiring a reset of the atomic integer to a new, larger than before, value.

Parameters
g
Exceptions
DENOPTIMException

Definition at line 55 of file GraphUtils.java.

References denoptim.utils.GraphUtils.getUniqueVertexIndex(), and denoptim.utils.GraphUtils.resetUniqueVertexCounter().

Referenced by denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.DGraph.removeVertexAndWeld(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), and denoptim.ga.EAUtils.setVertexCounterValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLabel() [1/2]

static String denoptim.utils.GraphUtils.getLabel ( DGraph  g,
int  vIdx 
)
static

Definition at line 220 of file GraphUtils.java.

References denoptim.graph.DGraph.getGraphId(), denoptim.graph.Vertex.getProperty(), denoptim.graph.DGraph.getVertexAtPosition(), and denoptim.graph.Vertex.hasProperty().

Here is the call graph for this function:

◆ getLabel() [2/2]

static String denoptim.utils.GraphUtils.getLabel ( Vertex  v)
static

Definition at line 210 of file GraphUtils.java.

References denoptim.graph.DGraph.getGraphId(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.Vertex.getProperty(), and denoptim.graph.Vertex.hasProperty().

Referenced by denoptim.ga.GraphOperationsTest.testLocateCompatibleXOverPoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUniqueGraphIndex()

static synchronized int denoptim.utils.GraphUtils.getUniqueGraphIndex ( )
static

◆ getUniqueMoleculeIndex()

static synchronized int denoptim.utils.GraphUtils.getUniqueMoleculeIndex ( )
static

Unique counter for the number of molecules generated.

Returns
the new molecule id (number)

Definition at line 184 of file GraphUtils.java.

References denoptim.utils.GraphUtils.molCounter.

Referenced by denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.ga.EAUtils.getPopulationFromFile(), denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint(), denoptim.ga.EAUtils.readCandidateFromFile(), and denoptim.combinatorial.GraphBuildingTask.sendToFitnessProvider().

Here is the caller graph for this function:

◆ getUniqueVertexIndex()

static synchronized long denoptim.utils.GraphUtils.getUniqueVertexIndex ( )
static

Unique counter for the number of graph vertices generated.

Returns
the new vertex id (number)

Definition at line 97 of file GraphUtils.java.

References denoptim.utils.GraphUtils.vertexCounter.

Referenced by denoptim.graph.DGraph.addCappingGroups(), denoptim.ga.GraphOperations.addRing(), denoptim.ga.GraphOperations.attachFragmentInClosableChain(), denoptim.ga.GraphOperationsTest.buildFragment(), denoptim.graph.EmptyVertex.EmptyVertex(), denoptim.utils.GraphUtils.ensureVertexIDConsistency(), denoptim.ga.GraphOperations.extendGraph(), denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.graph.TemplateTest.getAmideFragment(), denoptim.fragspace.FragmentSpaceTest.getCarbonVertex(), denoptim.graph.TemplateTest.getCH2Fragment(), denoptim.graph.TemplateTest.getOHFragment(), denoptim.fragspace.FragmentSpaceTest.getRCV(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), denoptim.graph.DGraph.insertVertex(), denoptim.combinatorial.CombinatorialExplorerByLayer.makeCheckPoint(), denoptim.fragspace.FragmentSpace.makeRandomScaffold(), denoptim.graph.Vertex.newVertexFromLibrary(), denoptim.fragspace.FragsCombinationIterator.next(), denoptim.graph.DGraph.renumberVerticesGetMap(), denoptim.graph.DGraph.replaceVertex(), denoptim.combinatorial.CombinatorialExplorerByLayer.startNewGraphFromScaffold(), denoptim.fragspace.FragmentSpaceTest.testSymmetry(), and denoptim.graph.Vertex.Vertex().

Here is the caller graph for this function:

◆ resetUniqueGraphCounter()

static synchronized void denoptim.utils.GraphUtils.resetUniqueGraphCounter ( int  val) throws DENOPTIMException
static

Reset the unique graph counter to the given value.

In order to keep the uniqueness on the index, this method accepts only reset values that are higher that the current one. Attempts to reset to lower values return an exception.

Parameters
valthe new value for the counter. This value will be given to next call of the getUniqueGraphIndex method.
Exceptions
DENOPTIMExceptionif the reset value is lower than the current value of the index.

Definition at line 121 of file GraphUtils.java.

References denoptim.utils.GraphUtils.graphCounter.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().

Here is the caller graph for this function:

◆ resetUniqueMoleculeCounter()

static synchronized void denoptim.utils.GraphUtils.resetUniqueMoleculeCounter ( int  val) throws DENOPTIMException
static

Reset the unique mol counter to the given value.

In order to keep the uniqueness on the index, this method accepts only reset values that are higher that the current one. Attempts to reset to lower values return an exception.

Parameters
valthe new value for the counter. This value will be given to next call of the getUniqueMoleculeIndex method.
Exceptions
DENOPTIMExceptionif the reset value is lower than the current value of the index.

Definition at line 164 of file GraphUtils.java.

References denoptim.utils.GraphUtils.molCounter.

Referenced by denoptim.combinatorial.CombinatorialExplorerByLayer.run().

Here is the caller graph for this function:

◆ resetUniqueVertexCounter()

static synchronized void denoptim.utils.GraphUtils.resetUniqueVertexCounter ( long  l) throws DENOPTIMException
static

Reset the unique vertex counter to the given value.

In order to keep the uniqueness on the index, this method accepts only reset values that are higher that the current one. Attempts to reset to lower values return an exception.

Parameters
lthe new value for the counter. This value will be given to next call of the getUniqueVertexIndex method.
Exceptions
DENOPTIMExceptionif the reset value is lower than the current value of the index.

Definition at line 77 of file GraphUtils.java.

References denoptim.utils.GraphUtils.vertexCounter.

Referenced by denoptim.utils.GraphUtils.ensureVertexIDConsistency(), and denoptim.combinatorial.CombinatorialExplorerByLayer.run().

Here is the caller graph for this function:

◆ writeSDFFields()

static void denoptim.utils.GraphUtils.writeSDFFields ( IAtomContainer  iac,
DGraph  g 
) throws DENOPTIMException
static

Definition at line 195 of file GraphUtils.java.

References denoptim.constants.DENOPTIMConstants.GCODETAG, denoptim.constants.DENOPTIMConstants.GRAPHJSONTAG, denoptim.constants.DENOPTIMConstants.GRAPHTAG, and denoptim.constants.DENOPTIMConstants.PROVENANCE.

Referenced by denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), and denoptim.io.DenoptimIO.writeGraphsToSDF().

Here is the caller graph for this function:

Member Data Documentation

◆ graphCounter

AtomicInteger denoptim.utils.GraphUtils.graphCounter = new AtomicInteger(1)
staticprivate

◆ molCounter

AtomicInteger denoptim.utils.GraphUtils.molCounter = new AtomicInteger(1)
staticprivate

◆ vertexCounter

AtomicLong denoptim.utils.GraphUtils.vertexCounter = new AtomicLong(1)
static

The documentation for this class was generated from the following file: