$darkmode
DENOPTIM
denoptim.ga.GraphOperationsTest Class Reference

Unit test. More...

Collaboration diagram for denoptim.ga.GraphOperationsTest:
[legend]

Classes

class  ExtractPatternCase
 

Public Member Functions

void testExtractPattern_singleRingSystem () throws Throwable
 
void testExtractPattern_returnsEmptyListIfNoRings () throws Throwable
 
void testExtractPattern_fusedRings () throws Throwable
 
void testLocateCompatibleXOverPoints () throws Exception
 
void testAddRing () throws Exception
 
void testAddFusedRings () throws Exception
 
void testExtendGraph () throws Exception
 

Static Package Functions

static void setUpClass ()
 

Package Attributes

IChemObjectBuilder chemBuilder = DefaultChemObjectBuilder.getInstance()
 

Private Member Functions

ExtractPatternCase getFusedRings () throws Throwable
 Returns a molecule consisting of two pairs of fused rings connected by an oxygen atom. More...
 
DGraph buildGraph (List< Vertex > vertices, List< List< Integer > > edges) throws DENOPTIMException
 
void addRings (List< Vertex > vertices, DGraph g)
 
Set< DGraphgetExpectedSubgraphs (DGraph graph)
 
Vertex buildFragment (String elementSymbol, int apCount, boolean isRCV)
 
Point3d getRandomVector ()
 
DGraph getThreeCycle () throws DENOPTIMException
 Returns a 3-cycle. More...
 
DGraph[] getPairOfTestGraphs () throws Exception
 Generates a pair of graphs that include templates with free content. More...
 
FragmentSpace prepare () throws Exception
 Sets the compatibility matrix (src -> trg);. More...
 

Private Attributes

final Random rng = new Random()
 

Static Private Attributes

static APClass APCA
 
static APClass APCB
 
static APClass APCC
 
static APClass APCD
 
static APClass DEFAULT_APCLASS
 

Detailed Description

Unit test.

Author
Marco Foscato

Definition at line 90 of file GraphOperationsTest.java.

Member Function Documentation

◆ addRings()

void denoptim.ga.GraphOperationsTest.addRings ( List< Vertex vertices,
DGraph  g 
)
private

Definition at line 282 of file GraphOperationsTest.java.

References denoptim.graph.DGraph.addRing(), and denoptim.graph.Ring.addVertex().

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

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

◆ buildFragment()

Vertex denoptim.ga.GraphOperationsTest.buildFragment ( String  elementSymbol,
int  apCount,
boolean  isRCV 
)
private

Definition at line 335 of file GraphOperationsTest.java.

References denoptim.graph.Fragment.addAP(), denoptim.ga.GraphOperationsTest.chemBuilder, denoptim.ga.GraphOperationsTest.DEFAULT_APCLASS, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.ga.GraphOperationsTest.getRandomVector(), and denoptim.utils.GraphUtils.getUniqueVertexIndex().

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

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

◆ buildGraph()

DGraph denoptim.ga.GraphOperationsTest.buildGraph ( List< Vertex vertices,
List< List< Integer > >  edges 
) throws DENOPTIMException
private

Definition at line 246 of file GraphOperationsTest.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), and denoptim.graph.Vertex.getAttachmentPoints().

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

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

◆ getExpectedSubgraphs()

Set< DGraph > denoptim.ga.GraphOperationsTest.getExpectedSubgraphs ( DGraph  graph)
private

Definition at line 307 of file GraphOperationsTest.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.DGraph.removeVertex().

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

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

◆ getFusedRings()

ExtractPatternCase denoptim.ga.GraphOperationsTest.getFusedRings ( ) throws Throwable
private

Returns a molecule consisting of two pairs of fused rings connected by an oxygen atom.

The dots represents chords. The molecule looks as follows: Cl | ↑ O - C - C → ← N - | . | . ↑ . | . N - C - O - C - C - C → . | . | . ↓ . . N . . O . .

The atoms are labelled in order of the leftmost then topmost. 2 | ↑ 0 - 1 - 4 → ← 12 - | . | . ↑ . | . 3 - 6 - 7 - 8 - 10 - 11 → . | . | . ↓ . . 5 . . 9 . .

Definition at line 178 of file GraphOperationsTest.java.

References denoptim.ga.GraphOperationsTest.addRings(), denoptim.ga.GraphOperationsTest.buildFragment(), denoptim.ga.GraphOperationsTest.buildGraph(), denoptim.ga.GraphOperationsTest.getExpectedSubgraphs(), denoptim.graph.DGraph.renumberGraphVertices(), and denoptim.graph.DGraph.setScaffold().

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

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

◆ getPairOfTestGraphs()

DGraph[] denoptim.ga.GraphOperationsTest.getPairOfTestGraphs ( ) throws Exception
private

Generates a pair of graphs that include templates with free content.

The first graph is

               (A)--(A)-m5
              /
 m1-(A)--(A)-T1-(A)--(A)-m2-(B)--(B)-m3
              \
               (C)--(C)-m4

where template 'T1' is:

 
    (A)         (C)
   /           /
 tv0-(A)--(A)-tv1-(B)--(C)-tv2-(A)--(A)-tv3-(A)-
               \
                (A)--(A)-tv4-(A)--(A)-tv5-(A)-

And the second graph is

 f1-(A)--(A)-T1-(A)--(A)-f2-(B)--(B)-f3-(C)--(C)-f4
              \
               (C)--(C)-f5

where template 'T2' is:

 
        (C)
       /
 -(A)-tw1-(B)--(C)-tw2-(B)--(B)-tw3-(A)-(A)-tw4-(A)

Definition at line 650 of file GraphOperationsTest.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addVertex(), denoptim.ga.GraphOperationsTest.APCA, denoptim.ga.GraphOperationsTest.APCB, denoptim.ga.GraphOperationsTest.APCC, denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Template.ContractLevel.FREE, denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.BBType.NONE, denoptim.ga.GraphOperationsTest.prepare(), denoptim.graph.Template.setContractLevel(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.Template.setInnerGraph(), and denoptim.graph.Vertex.setProperty().

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

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

◆ getRandomVector()

Point3d denoptim.ga.GraphOperationsTest.getRandomVector ( )
private

Definition at line 361 of file GraphOperationsTest.java.

References denoptim.ga.GraphOperationsTest.rng.

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

Here is the caller graph for this function:

◆ getThreeCycle()

DGraph denoptim.ga.GraphOperationsTest.getThreeCycle ( ) throws DENOPTIMException
private

Returns a 3-cycle.

The S marks the scaffold vertex: /— S —\ / \ RCV -(chord)- RCV

Definition at line 379 of file GraphOperationsTest.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.graph.Vertex.getAP(), and denoptim.graph.DGraph.renumberGraphVertices().

Referenced by denoptim.ga.GraphOperationsTest.testExtractPattern_returnsEmptyListIfNoRings(), and denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem().

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

◆ prepare()

FragmentSpace denoptim.ga.GraphOperationsTest.prepare ( ) throws Exception
private

Sets the compatibility matrix (src -> trg);.

     |  A  |  B  |  C  |  D  |
   ---------------------------
   A |  T  |     |     |     |
   ---------------------------
   B |     |  T  |  T  |     |
   ---------------------------
   C |     |     |  T   |     |
   ---------------------------
   D |     |     |     |  T  |

Definition at line 825 of file GraphOperationsTest.java.

References denoptim.ga.GraphOperationsTest.APCA, denoptim.ga.GraphOperationsTest.APCB, denoptim.ga.GraphOperationsTest.APCC, denoptim.ga.GraphOperationsTest.APCD, denoptim.graph.APClass.make(), and denoptim.fragspace.FragmentSpace.setAPclassBasedApproach().

Referenced by denoptim.ga.GraphOperationsTest.getPairOfTestGraphs(), and denoptim.ga.GraphOperationsTest.testLocateCompatibleXOverPoints().

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

◆ setUpClass()

static void denoptim.ga.GraphOperationsTest.setUpClass ( )
staticpackage

Definition at line 101 of file GraphOperationsTest.java.

References denoptim.ga.GraphOperationsTest.DEFAULT_APCLASS, and denoptim.graph.APClass.make().

Here is the call graph for this function:

◆ testAddFusedRings()

◆ testAddRing()

◆ testExtendGraph()

◆ testExtractPattern_fusedRings()

void denoptim.ga.GraphOperationsTest.testExtractPattern_fusedRings ( ) throws Throwable

Definition at line 146 of file GraphOperationsTest.java.

References denoptim.graph.DGraph.extractPattern(), denoptim.ga.GraphOperationsTest.ExtractPatternCase.g, denoptim.ga.GraphOperationsTest.getFusedRings(), denoptim.ga.GraphOperationsTest.ExtractPatternCase.matchesExpected(), and denoptim.graph.GraphPattern.RING.

Here is the call graph for this function:

◆ testExtractPattern_returnsEmptyListIfNoRings()

void denoptim.ga.GraphOperationsTest.testExtractPattern_returnsEmptyListIfNoRings ( ) throws Throwable

Definition at line 133 of file GraphOperationsTest.java.

References denoptim.graph.DGraph.extractPattern(), denoptim.graph.DGraph.getRings(), denoptim.ga.GraphOperationsTest.getThreeCycle(), denoptim.graph.DGraph.removeRing(), and denoptim.graph.GraphPattern.RING.

Here is the call graph for this function:

◆ testExtractPattern_singleRingSystem()

void denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem ( ) throws Throwable

◆ testLocateCompatibleXOverPoints()

Member Data Documentation

◆ APCA

◆ APCB

◆ APCC

APClass denoptim.ga.GraphOperationsTest.APCC
staticprivate

◆ APCD

APClass denoptim.ga.GraphOperationsTest.APCD
staticprivate

Definition at line 92 of file GraphOperationsTest.java.

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

◆ chemBuilder

IChemObjectBuilder denoptim.ga.GraphOperationsTest.chemBuilder = DefaultChemObjectBuilder.getInstance()
package

◆ DEFAULT_APCLASS

APClass denoptim.ga.GraphOperationsTest.DEFAULT_APCLASS
staticprivate

◆ rng

final Random denoptim.ga.GraphOperationsTest.rng = new Random()
private

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