$darkmode
|
DENOPTIM
|
Unit test. More...
Public Member Functions | |
| void | testXOverCompatibility () throws Exception |
| void | testClone () throws Exception |
| void | testGetMinMax () throws Exception |
| void | testIsInPercentile () throws Exception |
| void | testPopulationVersion () throws Exception |
Static Public Member Functions | |
| static GAParameters | prepare () throws DENOPTIMException |
| static DGraph[] | getPairOfTestGraphsB () throws Exception |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract. More... | |
| static DGraph[] | getPairOfTestGraphsBxo () throws Exception |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract. More... | |
| static DGraph[] | getPairOfTestGraphsBxoxo () throws Exception |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract. More... | |
Static Package Functions | |
| static DGraph | makeGraphA () throws DENOPTIMException |
| Produced a graph like this: More... | |
| static DGraph | makeGraphB () throws DENOPTIMException |
| Produced a graph like this: More... | |
| static DGraph | makeGraphC () throws DENOPTIMException |
| Produced a graph like this: More... | |
| static DGraph | makeGraphD () throws DENOPTIMException |
| Produced a graph like this: More... | |
| static DGraph | makeGraphE () throws DENOPTIMException |
| Produced a graph like this: More... | |
| static DGraph | makeGraphF () throws DENOPTIMException |
| Produced a graph like this: More... | |
Private Member Functions | |
| void | compareSitesLists (List< XoverSite > listA, List< XoverSite > listB) |
| Assumes the two lists have equal size. More... | |
| void | compareSizeOfSites (Candidate parentA, Map< Candidate, Integer > expectedForC1, List< Candidate > partnersForC1, Population pop) |
Static Private Attributes | |
| static APClass | APCA |
| static APClass | APCB |
| static APClass | APCC |
| static APClass | APCD |
Unit test.
Definition at line 57 of file PopulationTest.java.
|
private |
Assumes the two lists have equal size.
Definition at line 286 of file PopulationTest.java.
Referenced by denoptim.ga.PopulationTest.testClone().
|
private |
Definition at line 297 of file PopulationTest.java.
References denoptim.graph.Candidate.getName(), and denoptim.ga.Population.getXoverSites().
Referenced by denoptim.ga.PopulationTest.testClone(), and denoptim.ga.PopulationTest.testXOverCompatibility().
|
static |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract.
First Graph structure:
(C)--(C)-v1
/
v0-(A)--(A)-T1-(B)--(B)-v2-(C)--(C)-v3
where template T1 is
(A)-v0-(A)--(A)-v1-(B)--(B)-v2-(C)
| |
(A) (A)--(A)-v5
| |
| chord
| |
(A) (A)--(A)-v6
| |
v3-(A)--(A)-v4-(B)
The second Graph structure:
v0-(A)--(A)-T2-(B)--(B)-v2-(C)--(C)-v3
where template T2 is
(A)-v0-(A)--(A)-v1-(B)--(B)-v2
|
(A)
|
(A) (A)--(A)-v5
| |
v3-(A)--(A)-v4-(B)
NB: the graphs from methods getPairOfTestGraphsB() and getPairOfTestGraphsBxo() and
getPairOfTestGraphsBxoxo() are a sequence resulting from crossover operations. Note that the order of APs in on the templates changes as a result of the crossover. For this reason, the backwards crossover of the graphs from getPairOfTestGraphsBxo() does not produce the graphs from getPairOfTestGraphsB(), but those from getPairOfTestGraphsBxoxo().
Definition at line 735 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.ga.PopulationTest.APCC, denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Template.ContractLevel.FREE, denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.BBType.NONE, denoptim.graph.Vertex.setAsRCV(), denoptim.graph.Template.setContractLevel(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.Template.setInnerGraph(), denoptim.graph.Vertex.setProperty(), and denoptim.graph.Edge.BondType.SINGLE.
Referenced by denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), and denoptim.utils.GraphConversionToolTest.testGetJGraphKernelFromGraph().
|
static |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract.
First Graph structure:
(B)--(C)-v1
/
v0-(A)--(A)-T1-(B)--(B)-v2-(C)--(C)-v3
where template T1 is
(B)
/
(A)-v0-(A)--(A)-v4-(A)--(A)-v5
|
(A)
|
(A) (A)--(A)-v3
| |
v1-(A)--(A)-v2-(B)
T
he second Graph structure:
v0-(A)--(A)-T2-(C)--(B)-v2-(C)--(C)-v3
where template T2 is
(A)-v0-(A)--(A)-v1-(B)--(B)-v2
|
(A)
|
(A) (A)--(A)-v5
| |
v3-(A)--(A)-v4-(B)--(B)-v6-(C)
NB: the graphs from methods getPairOfTestGraphsB() and getPairOfTestGraphsBxo() and
getPairOfTestGraphsBxoxo() are a sequence resulting from crossover operations. Note that the order of APs in on the templates changes as a result of the crossover. For this reason, the backwards crossover of the graphs from getPairOfTestGraphsBxo() does not produce the graphs from getPairOfTestGraphsB(), but those from getPairOfTestGraphsBxoxo().
Definition at line 944 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.ga.PopulationTest.APCC, denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Template.ContractLevel.FREE, denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.BBType.NONE, denoptim.graph.Vertex.setAsRCV(), denoptim.graph.Template.setContractLevel(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.Template.setInnerGraph(), and denoptim.graph.Vertex.setProperty().
Referenced by denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), and denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards().
|
static |
Builds a pair of graphs that contain templates with ContractLevel#FREE contract.
First Graph structure:
(C)--(C)-v1
/
v0-(A)--(A)-T1-(B)--(B)-v2-(C)--(C)-v3
where template T1 is
(A)-v0-(A)--(A)-v4-(B)--(B)-v6-(C)
| |
(A) (A)--(A)-v5
| |
| chord
| |
(A) (A)--(A)-v3
| |
v1-(A)--(A)-v2-(B)
The second Graph structure:
v0-(A)--(A)-T2-(B)--(B)-v2-(C)--(C)-v3
where template T2 is
(A)-v0-(A)--(A)-v1-(B)--(B)-v2
|
(A)
|
(A) (A)--(A)-v5
| |
v3-(A)--(A)-v4-(B)
NB: the graphs from methods getPairOfTestGraphsB() and getPairOfTestGraphsBxo() and
getPairOfTestGraphsBxoxo() are a sequence resulting from crossover operations. Note that the order of APs in on the templates changes as a result of the crossover. For this reason, the backwards crossover of the graphs from getPairOfTestGraphsBxo() does not produce the graphs from getPairOfTestGraphsB(), but those from getPairOfTestGraphsBxoxo(). Still, for simple cases there there is no branching, there is no change in the order of the APs upon crossover. For this reason, the second graph returned here is the same as the second returned by getPairOfTestGraphsB()
Definition at line 1158 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.ga.PopulationTest.APCC, denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Template.ContractLevel.FREE, denoptim.graph.Vertex.getAP(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.graph.Vertex.BBType.NONE, denoptim.graph.Vertex.setAsRCV(), denoptim.graph.Template.setContractLevel(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.Template.setInnerGraph(), denoptim.graph.Vertex.setProperty(), and denoptim.graph.Edge.BondType.SINGLE.
Referenced by denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards().
|
staticpackage |
Produced a graph like this:
-(A)v0(A)-(A)v1(A)-(A)v2(A)-(A)v3(B)-(B)v4(B)-(B)v5(B)-
You must run prepare() before asking this class for any graph.
Definition at line 323 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
Referenced by denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph(), denoptim.ga.PopulationTest.testClone(), denoptim.ga.PopulationTest.testGetMinMax(), denoptim.ga.PopulationTest.testIsInPercentile(), denoptim.ga.PopulationTest.testPopulationVersion(), and denoptim.ga.PopulationTest.testXOverCompatibility().
|
staticpackage |
Produced a graph like this:
v0(A)-(A)v1(A)-(A)v2
You must run prepare() before asking this class for any graph.
Definition at line 372 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
Referenced by denoptim.ga.PopulationTest.testClone(), denoptim.ga.PopulationTest.testGetMinMax(), denoptim.ga.PopulationTest.testIsInPercentile(), denoptim.ga.PopulationTest.testPopulationVersion(), and denoptim.ga.PopulationTest.testXOverCompatibility().
|
staticpackage |
Produced a graph like this:
-(C)v0(C)-(C)v1(A)-(A)v2
You must run prepare() before asking this class for any graph.
Definition at line 404 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCC, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
Referenced by denoptim.ga.PopulationTest.testGetMinMax(), denoptim.ga.PopulationTest.testPopulationVersion(), and denoptim.ga.PopulationTest.testXOverCompatibility().
|
staticpackage |
Produced a graph like this:
v0(D)-(D)v1
You must run prepare() before asking this class for any graph.
Definition at line 437 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCD, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
Referenced by denoptim.ga.PopulationTest.testGetMinMax(), and denoptim.ga.PopulationTest.testXOverCompatibility().
|
staticpackage |
Produced a graph like this:
v0(B)-(B)v1(A)-(A)v2(B)-(B)v3(A)-(A)v4(B)-(B)v5
You must run prepare() before asking this class for any graph.
Definition at line 463 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
Referenced by denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph().
|
staticpackage |
Produced a graph like this:
-(A)v0(A)-(A)v1(A)-(A)v2(A)-(A)v3(A)-(A)v4(A)-(A)v5(A)-(A)v6(A)-(A)v7(A)-
You must run prepare() before asking this class for any graph.
Definition at line 509 of file PopulationTest.java.
References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.ga.PopulationTest.APCA, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.graph.Vertex.setBuildingBlockType().
|
static |
Definition at line 63 of file PopulationTest.java.
References denoptim.ga.PopulationTest.APCA, denoptim.ga.PopulationTest.APCB, denoptim.ga.PopulationTest.APCC, denoptim.ga.PopulationTest.APCD, denoptim.graph.Edge.BondType.DOUBLE, denoptim.graph.APClass.make(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.programs.RunTimeParameters.readParameterLine(), denoptim.fragspace.FragmentSpace.setAPclassBasedApproach(), denoptim.programs.RunTimeParameters.setParameters(), and denoptim.graph.Edge.BondType.SINGLE.
Referenced by denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards(), denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph(), denoptim.ga.PopulationTest.testClone(), denoptim.utils.GraphConversionToolTest.testGetJGraphKernelFromGraph(), denoptim.ga.PopulationTest.testGetMinMax(), denoptim.ga.PopulationTest.testIsInPercentile(), denoptim.ga.PopulationTest.testPopulationVersion(), and denoptim.ga.PopulationTest.testXOverCompatibility().
| void denoptim.ga.PopulationTest.testClone | ( | ) | throws Exception |
Definition at line 234 of file PopulationTest.java.
References denoptim.ga.Population.add(), denoptim.ga.Population.clone(), denoptim.ga.PopulationTest.compareSitesLists(), denoptim.ga.PopulationTest.compareSizeOfSites(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.ga.Population.getXoverPartners(), denoptim.ga.Population.getXoverSites(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.prepare(), denoptim.graph.Vertex.setProperty(), and denoptim.graph.Vertex.setUniquefyingProperty().
| void denoptim.ga.PopulationTest.testGetMinMax | ( | ) | throws Exception |
Definition at line 562 of file PopulationTest.java.
References denoptim.ga.Population.add(), denoptim.ga.Population.getMaxFitness(), denoptim.ga.Population.getMinFitness(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphD(), denoptim.ga.PopulationTest.prepare(), and denoptim.graph.Candidate.setFitness().
| void denoptim.ga.PopulationTest.testIsInPercentile | ( | ) | throws Exception |
Definition at line 602 of file PopulationTest.java.
References denoptim.ga.Population.add(), denoptim.ga.Population.isWithinPercentile(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.prepare(), and denoptim.graph.Candidate.setFitness().
| void denoptim.ga.PopulationTest.testPopulationVersion | ( | ) | throws Exception |
Definition at line 643 of file PopulationTest.java.
References denoptim.ga.Population.add(), denoptim.ga.Population.getVersionID(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.prepare(), denoptim.ga.Population.remove(), and denoptim.ga.Population.set().
| void denoptim.ga.PopulationTest.testXOverCompatibility | ( | ) | throws Exception |
Definition at line 122 of file PopulationTest.java.
References denoptim.ga.Population.add(), denoptim.ga.PopulationTest.compareSizeOfSites(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.getVertexCount(), denoptim.ga.Population.getXoverPartners(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphD(), denoptim.ga.PopulationTest.prepare(), denoptim.graph.Vertex.setProperty(), and denoptim.graph.Vertex.setUniquefyingProperty().
|
staticprivate |
Definition at line 59 of file PopulationTest.java.
Referenced by denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphE(), denoptim.ga.PopulationTest.makeGraphF(), and denoptim.ga.PopulationTest.prepare().
|
staticprivate |
Definition at line 59 of file PopulationTest.java.
Referenced by denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphE(), and denoptim.ga.PopulationTest.prepare().
|
staticprivate |
Definition at line 59 of file PopulationTest.java.
Referenced by denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.ga.PopulationTest.makeGraphC(), and denoptim.ga.PopulationTest.prepare().
|
staticprivate |
Definition at line 59 of file PopulationTest.java.
Referenced by denoptim.ga.PopulationTest.makeGraphD(), and denoptim.ga.PopulationTest.prepare().