$darkmode
DENOPTIM
denoptim.ga.XoverSite Class Reference

This class collects the data identifying the subgraphs that would be swapped by a crossover event. More...

Inheritance diagram for denoptim.ga.XoverSite:
[legend]
Collaboration diagram for denoptim.ga.XoverSite:
[legend]

Public Member Functions

 XoverSite ()
 Initiate an empty data structure. More...
 
 XoverSite (List< Vertex > subGraphA, List< Vertex > subGraphB, CrossoverType xoverType)
 Create a site by listing the vertexes that belong to each of the subgraphs that should be swapped by a crossover operation. More...
 
 XoverSite (List< Vertex > subGraphA, List< AttachmentPoint > needyAPsOnA, List< Vertex > subGraphB, List< AttachmentPoint > needyAPsOnB, CrossoverType xoverType)
 Create a site by listing the vertexes that belong to each of the subgraphs that should be swapped by a crossover operation. More...
 
XoverSite createMirror ()
 Creates a new XoverSite that considers the opposite order of candidates of this one. More...
 
XoverSite clone ()
 Creates a new XoverSite that contains the same information of this one, i.e., a shallow copy. More...
 
List< VertexgetA ()
 Returns the collection of vertexes belonging to the first subgraph. More...
 
List< VertexgetB ()
 Returns the collection of vertexes belonging to the second subgraph. More...
 
List< AttachmentPointgetAPsNeedingMappingA ()
 Returns the collection of attachment points that need to be mapped in order to achieve a valid crossover that swaps the subgraphs and respects the requirements of each side. More...
 
List< AttachmentPointgetAPsNeedingMappingB ()
 Returns the collection of attachment points that need to be mapped in order to achieve a valid crossover that swaps the subgraphs and respects the requirements of each side. More...
 
CrossoverType getType ()
 Returns the type of crossover. More...
 
boolean equals (Object o)
 Compares this and another instance. More...
 
XoverSite projectToClonedGraphs () throws DENOPTIMException
 Creates a new instance of this class that contains the list of vertexes that correspond to those contained in this XoverSite but with references to the vertexes of an entirely new pair of graphs made as clones of the original graphs. More...
 
String toString ()
 Produced a string for showing what this object is. More...
 

Private Attributes

List< VertexsubGraphA = null
 One of the two subgraphs. More...
 
List< AttachmentPointneedyAPsOnA = null
 List of attachment points on subgraph B and that need to be replaced by a corresponding attachment point in case of crossover. More...
 
List< VertexsubGraphB = null
 The other of the two subgraphs. More...
 
List< AttachmentPointneedyAPsOnB = null
 List of attachment points on subgraph A and that need to be replaced by a corresponding attachment point in case of crossover. More...
 
CrossoverType xoverType = null
 Type of crossover. More...
 

Detailed Description

This class collects the data identifying the subgraphs that would be swapped by a crossover event.

Definition at line 35 of file XoverSite.java.

Constructor & Destructor Documentation

◆ XoverSite() [1/3]

denoptim.ga.XoverSite.XoverSite ( )

Initiate an empty data structure.

Definition at line 77 of file XoverSite.java.

References denoptim.ga.XoverSite.needyAPsOnA, denoptim.ga.XoverSite.needyAPsOnB, denoptim.ga.XoverSite.subGraphA, and denoptim.ga.XoverSite.subGraphB.

Referenced by denoptim.ga.XoverSite.clone(), denoptim.ga.XoverSite.createMirror(), denoptim.ga.XoverSite.equals(), and denoptim.ga.XoverSite.projectToClonedGraphs().

Here is the caller graph for this function:

◆ XoverSite() [2/3]

denoptim.ga.XoverSite.XoverSite ( List< Vertex subGraphA,
List< Vertex subGraphB,
CrossoverType  xoverType 
)

Create a site by listing the vertexes that belong to each of the subgraphs that should be swapped by a crossover operation.

Parameters
subGraphAthe vertexes defining a subgraph to be swapped. The first vertex must be the deepest one, i.e., the source of a directed spanning tree.
subGraphBthe vertexes defining another subgraph to be swapped. The first vertex must be the deepest one, i.e., the source of a directed spanning tree.
xoverTypethe type of crossover.

Definition at line 99 of file XoverSite.java.

References denoptim.graph.DGraph.getInterfaceAPs(), denoptim.ga.XoverSite.subGraphA, denoptim.ga.XoverSite.subGraphB, and denoptim.ga.XoverSite.xoverType.

Here is the call graph for this function:

◆ XoverSite() [3/3]

denoptim.ga.XoverSite.XoverSite ( List< Vertex subGraphA,
List< AttachmentPoint needyAPsOnA,
List< Vertex subGraphB,
List< AttachmentPoint needyAPsOnB,
CrossoverType  xoverType 
)

Create a site by listing the vertexes that belong to each of the subgraphs that should be swapped by a crossover operation.

Parameters
subGraphAthe vertexes defining a subgraph to be swapped. The first vertex must be the deepest one, i.e., the source of a directed spanning tree.
needyAPsOnAa subset of the attachment points in the first subgraph that are required to have a mapping in the second subgraph.
subGraphBthe vertexes defining another subgraph to be swapped. The first vertex must be the deepest one, i.e., the source of a directed spanning tree.
needyAPsOnBa subset of the attachment points in the second subgraph that are required to have an AP mapping in the first subgraph.
xoverTypethe type of crossover.

Definition at line 130 of file XoverSite.java.

References denoptim.ga.XoverSite.needyAPsOnA, denoptim.ga.XoverSite.needyAPsOnB, denoptim.ga.XoverSite.subGraphA, denoptim.ga.XoverSite.subGraphB, and denoptim.ga.XoverSite.xoverType.

Member Function Documentation

◆ clone()

XoverSite denoptim.ga.XoverSite.clone ( )

Creates a new XoverSite that contains the same information of this one, i.e., a shallow copy.

Definition at line 168 of file XoverSite.java.

References denoptim.ga.XoverSite.clone(), denoptim.ga.XoverSite.XoverSite(), and denoptim.ga.XoverSite.xoverType.

Referenced by denoptim.ga.XoverSite.clone().

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

◆ createMirror()

XoverSite denoptim.ga.XoverSite.createMirror ( )

Creates a new XoverSite that considers the opposite order of candidates of this one.

Definition at line 149 of file XoverSite.java.

References denoptim.ga.XoverSite.XoverSite(), and denoptim.ga.XoverSite.xoverType.

Referenced by denoptim.ga.Population.XoverSitesAmongCandidates.put().

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

◆ equals()

boolean denoptim.ga.XoverSite.equals ( Object  o)

Compares this and another instance.

Parameters
other
Returns
true is the two include lists of vertexes that have the same vertex in the same order (i.e., List#equals are true for each collections individually).

Definition at line 252 of file XoverSite.java.

References denoptim.ga.XoverSite.needyAPsOnA, denoptim.ga.XoverSite.needyAPsOnB, denoptim.ga.XoverSite.subGraphA, denoptim.ga.XoverSite.subGraphB, and denoptim.ga.XoverSite.XoverSite().

Here is the call graph for this function:

◆ getA()

List< Vertex > denoptim.ga.XoverSite.getA ( )

Returns the collection of vertexes belonging to the first subgraph.

Returns
the collection of vertexes belonging to the first subgraph.

Definition at line 187 of file XoverSite.java.

References denoptim.ga.XoverSite.subGraphA.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.XoverSiteTest.testProjectToClonedGraphs().

Here is the caller graph for this function:

◆ getAPsNeedingMappingA()

List< AttachmentPoint > denoptim.ga.XoverSite.getAPsNeedingMappingA ( )

Returns the collection of attachment points that need to be mapped in order to achieve a valid crossover that swaps the subgraphs and respects the requirements of each side.

Returns
the collection of "needy" attachment points belonging to the first subgraph.

Definition at line 212 of file XoverSite.java.

References denoptim.ga.XoverSite.needyAPsOnA.

Referenced by denoptim.ga.XoverSiteTest.testProjectToClonedGraphs().

Here is the caller graph for this function:

◆ getAPsNeedingMappingB()

List< AttachmentPoint > denoptim.ga.XoverSite.getAPsNeedingMappingB ( )

Returns the collection of attachment points that need to be mapped in order to achieve a valid crossover that swaps the subgraphs and respects the requirements of each side.

Returns
the collection of "needy" attachment points belonging to the second subgraph.

Definition at line 226 of file XoverSite.java.

References denoptim.ga.XoverSite.needyAPsOnB.

Referenced by denoptim.ga.XoverSiteTest.testProjectToClonedGraphs().

Here is the caller graph for this function:

◆ getB()

List< Vertex > denoptim.ga.XoverSite.getB ( )

Returns the collection of vertexes belonging to the second subgraph.

Returns
the collection of vertexes belonging to the second subgraph.

Definition at line 198 of file XoverSite.java.

References denoptim.ga.XoverSite.subGraphB.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.XoverSiteTest.testProjectToClonedGraphs().

Here is the caller graph for this function:

◆ getType()

CrossoverType denoptim.ga.XoverSite.getType ( )

Returns the type of crossover.

Returns
the type of crossover.

Definition at line 237 of file XoverSite.java.

References denoptim.ga.XoverSite.xoverType.

◆ projectToClonedGraphs()

XoverSite denoptim.ga.XoverSite.projectToClonedGraphs ( ) throws DENOPTIMException

Creates a new instance of this class that contains the list of vertexes that correspond to those contained in this XoverSite but with references to the vertexes of an entirely new pair of graphs made as clones of the original graphs.

Note that since the graphs can be embedded in templates, the entire embedding structure is cloned as well.

Returns
an analog yet independent crossover site.
Exceptions
DENOPTIMException

Definition at line 275 of file XoverSite.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.getEmbeddedGraphInClone(), denoptim.graph.DGraph.getEmbeddingPath(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.ga.XoverSite.needyAPsOnA, denoptim.ga.XoverSite.needyAPsOnB, denoptim.graph.DGraph.renumberGraphVertices(), denoptim.ga.XoverSite.subGraphA, denoptim.ga.XoverSite.subGraphB, denoptim.ga.XoverSite.XoverSite(), and denoptim.ga.XoverSite.xoverType.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.XoverSiteTest.testProjectToClonedGraphs().

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

◆ toString()

String denoptim.ga.XoverSite.toString ( )

Produced a string for showing what this object is.

Definition at line 349 of file XoverSite.java.

References denoptim.ga.XoverSite.subGraphA, denoptim.ga.XoverSite.subGraphB, and denoptim.ga.XoverSite.xoverType.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the caller graph for this function:

Member Data Documentation

◆ needyAPsOnA

List<AttachmentPoint> denoptim.ga.XoverSite.needyAPsOnA = null
private

List of attachment points on subgraph B and that need to be replaced by a corresponding attachment point in case of crossover.

These APs might be used or free, which essentially means they are either required somehow, or are used in an outer level, i.e., projected onto an embedding template and used from there.

Definition at line 50 of file XoverSite.java.

Referenced by denoptim.ga.XoverSite.equals(), denoptim.ga.XoverSite.getAPsNeedingMappingA(), denoptim.ga.XoverSite.projectToClonedGraphs(), and denoptim.ga.XoverSite.XoverSite().

◆ needyAPsOnB

List<AttachmentPoint> denoptim.ga.XoverSite.needyAPsOnB = null
private

List of attachment points on subgraph A and that need to be replaced by a corresponding attachment point in case of crossover.

These APs might be used or free, which essentially means they are either required somehow, or are used in an outer level, i.e., projected onto an embedding template and used from there.

Definition at line 65 of file XoverSite.java.

Referenced by denoptim.ga.XoverSite.equals(), denoptim.ga.XoverSite.getAPsNeedingMappingB(), denoptim.ga.XoverSite.projectToClonedGraphs(), and denoptim.ga.XoverSite.XoverSite().

◆ subGraphA

List<Vertex> denoptim.ga.XoverSite.subGraphA = null
private

◆ subGraphB

List<Vertex> denoptim.ga.XoverSite.subGraphB = null
private

◆ xoverType


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