$darkmode
DENOPTIM
|
This class represents the closure of a ring in a spanning tree. More...
Classes | |
class | DENOPTIMRingSerializer |
Public Member Functions | |
Ring () | |
Ring (List< Vertex > vertices) | |
void | addVertex (Vertex v) |
Append a DENOPTIMVertex to the list. More... | |
Vertex | getHeadVertex () |
Vertex | getTailVertex () |
Vertex | getVertexAtPosition (int i) |
int | indexOf (Vertex v) |
Returns the index of the first occurrence of the specified element in this ring, or -1 if this list does not contain the element. More... | |
int | getSize () |
BondType | getBondType () |
void | setBondType (BondType bndType) |
Set the bond type (i.e., bond order) of the chord connecting the head and the tail vertices. More... | |
boolean | contains (Vertex v) |
Checks whether a given vertex is part of this ring. More... | |
boolean | containsID (int vid) |
Checks whether a given vertex is part of this ring. More... | |
String | toString () |
List< Vertex > | getVertices () |
void | removeVertex (Vertex oldVrtx) |
void | replaceVertex (Vertex oldVrtx, Vertex newVrtx) |
Replaces a vertex that belong to this ring with a new one. More... | |
boolean | insertVertex (int position, Vertex newLink) |
Adds a vertex to the ring, in the given position. More... | |
boolean | insertVertex (Vertex newLink, Vertex vA, Vertex vB) |
Adds a vertex to the ring, and in between two defined vertices. More... | |
int | getDistance (Vertex v1, Vertex v2) throws DENOPTIMException |
Measures how many edges there are between two edges along the sequence of vertices that defined this fundamental ring. More... | |
Vertex | getCloserToHead (Vertex vA, Vertex vB) |
Chooses among the two given vertices the one that is closer to the head vertex. More... | |
Vertex | getCloserToTail (Vertex vA, Vertex vB) |
Chooses among the two given vertices the one that is closer to the tail vertex. More... | |
Vertex | getCloserTo (Vertex vA, Vertex vB, Vertex vT) |
Chooses among the two given vertices the one that is closer to the target vertex. More... | |
int | getPositionOf (Vertex v) |
Private Attributes | |
List< Vertex > | vertices |
List of DENOPTIMVertex involved in the ring. More... | |
BondType | bndTyp = BondType.UNDEFINED |
Bond type (i.e., bond order) to be used between head and tail vertices. More... | |
This class represents the closure of a ring in a spanning tree.
denoptim.graph.Ring.Ring | ( | ) |
Definition at line 53 of file Ring.java.
References denoptim.graph.Ring.vertices.
denoptim.graph.Ring.Ring | ( | List< Vertex > | vertices | ) |
Definition at line 60 of file Ring.java.
References denoptim.graph.Ring.vertices.
void denoptim.graph.Ring.addVertex | ( | Vertex | v | ) |
Append a DENOPTIMVertex
to the list.
Definition at line 71 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.ga.GraphOperationsTest.addRings(), denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), and denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets().
boolean denoptim.graph.Ring.contains | ( | Vertex | v | ) |
Checks whether a given vertex is part of this ring.
v | the candidate DENOPTIMVertex |
true
if the given vertex is contained in the list of DENOPTIMVertex
s involved in this ring Definition at line 172 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.Ring.getCloserTo(), denoptim.graph.Ring.getDistance(), and denoptim.graph.Ring.insertVertex().
boolean denoptim.graph.Ring.containsID | ( | int | vid | ) |
Checks whether a given vertex is part of this ring.
vid | the ID of the candidate DENOPTIMVertex |
true
if the list of DENOPTIMVertex
s involved in this ring contains the given vertex ID Definition at line 187 of file Ring.java.
References denoptim.graph.Ring.vertices.
BondType denoptim.graph.Ring.getBondType | ( | ) |
Definition at line 146 of file Ring.java.
References denoptim.graph.Ring.bndTyp.
Referenced by denoptim.graph.Ring.DENOPTIMRingSerializer.serialize().
Chooses among the two given vertices the one that is closer to the target vertex.
vA | first candidate. |
vB | second candidate. |
vT | the target vertex. |
Definition at line 378 of file Ring.java.
References denoptim.graph.Ring.contains(), and denoptim.graph.Ring.getDistance().
Referenced by denoptim.graph.Ring.getCloserToHead(), denoptim.graph.Ring.getCloserToTail(), and denoptim.graph.RingTest.testGetCloserVertex().
Chooses among the two given vertices the one that is closer to the head vertex.
vA | first candidate. |
vB | second candidate |
Definition at line 349 of file Ring.java.
References denoptim.graph.Ring.getCloserTo(), and denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.RingTest.testGetCloserVertex().
Chooses among the two given vertices the one that is closer to the tail vertex.
vA | first candidate. |
vB | second candidate |
Definition at line 363 of file Ring.java.
References denoptim.graph.Ring.getCloserTo(), and denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.RingTest.testGetCloserVertex().
int denoptim.graph.Ring.getDistance | ( | Vertex | v1, |
Vertex | v2 | ||
) | throws DENOPTIMException |
Measures how many edges there are between two edges along the sequence of vertices that defined this fundamental ring.
v1 | |
v2 |
DENOPTIMException | if either vertex is not part of this ring. |
Definition at line 325 of file Ring.java.
References denoptim.graph.Ring.contains(), and denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.Ring.getCloserTo(), denoptim.graph.RingTest.testGetDistance(), and denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate().
Vertex denoptim.graph.Ring.getHeadVertex | ( | ) |
DENOPTIMVertex
s involved in this ring Definition at line 83 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.sameAsRings(), and denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate().
int denoptim.graph.Ring.getPositionOf | ( | Vertex | v | ) |
v | the vertex to search for |
Definition at line 415 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.removeChainUpToBranching().
int denoptim.graph.Ring.getSize | ( | ) |
DENOPTIMVertex
s involved in this ring Definition at line 134 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.sameAsRings(), and denoptim.graph.Ring.DENOPTIMRingSerializer.serialize().
Vertex denoptim.graph.Ring.getTailVertex | ( | ) |
DENOPTIMVertex
s involved in this ring Definition at line 95 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.sameAsRings(), and denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate().
Vertex denoptim.graph.Ring.getVertexAtPosition | ( | int | i | ) |
DENOPTIMVertex
s involved in this ring Definition at line 107 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.sameAsRings(), denoptim.graph.Ring.DENOPTIMRingSerializer.serialize(), and denoptim.graph.RingTest.testGetCloserVertex().
List< Vertex > denoptim.graph.Ring.getVertices | ( | ) |
Definition at line 214 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.DGraph.extractPattern().
int denoptim.graph.Ring.indexOf | ( | Vertex | v | ) |
Returns the index of the first occurrence of the specified element in this ring, or -1 if this list does not contain the element.
Definition at line 122 of file Ring.java.
References denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.RingTest.testUndirectedComparison().
boolean denoptim.graph.Ring.insertVertex | ( | int | position, |
Vertex | newLink | ||
) |
Adds a vertex to the ring, in the given position.
Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
position | the position where the vertex will be found after insertion. |
newLink | vertex to add to this ring. |
true
if the vertex is inserted, or false
if the operation cannot be performed for any reason, e.g., the vertex is already contained in this ring. Definition at line 275 of file Ring.java.
References denoptim.graph.Ring.contains(), and denoptim.graph.Ring.vertices.
Referenced by denoptim.graph.RingTest.testUndirectedComparison().
Adds a vertex to the ring, and in between two defined vertices.
newLink | vertex to add to this ring. |
vA | one of the vertices in between which the new vertex should in inserted. |
vB | one of the vertices in between which the new vertex should in inserted. |
true
if the vertex is inserted, or false
if the operation cannot be performed for any reason, e.g., the vertex is already contained in this ring, or either of the two reference vertices are not themselves contained here. Definition at line 298 of file Ring.java.
References denoptim.graph.Ring.contains(), and denoptim.graph.Ring.vertices.
void denoptim.graph.Ring.removeVertex | ( | Vertex | oldVrtx | ) |
Definition at line 242 of file Ring.java.
References denoptim.graph.Ring.vertices.
Replaces a vertex that belong to this ring with a new one.
oldVrtx | the vertex to be replaced. |
newVrtx | the vertex the replace the old one with. |
Definition at line 255 of file Ring.java.
References denoptim.graph.Ring.vertices.
void denoptim.graph.Ring.setBondType | ( | BondType | bndType | ) |
Set the bond type (i.e., bond order) of the chord connecting the head and the tail vertices.
Definition at line 158 of file Ring.java.
Referenced by denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.clone(), denoptim.graph.rings.CyclicGraphHandler.combineCompatPathSubGraphs(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), and denoptim.graph.rings.RandomCombOfRingsIterator.next().
String denoptim.graph.Ring.toString | ( | ) |
Definition at line 208 of file Ring.java.
References denoptim.graph.Ring.vertices.
|
private |
Bond type (i.e., bond order) to be used between head and tail vertices.
Definition at line 49 of file Ring.java.
Referenced by denoptim.graph.Ring.getBondType().
|
private |
List of DENOPTIMVertex
involved in the ring.
Definition at line 44 of file Ring.java.
Referenced by denoptim.graph.Ring.addVertex(), denoptim.graph.Ring.contains(), denoptim.graph.Ring.containsID(), denoptim.graph.Ring.getCloserToHead(), denoptim.graph.Ring.getCloserToTail(), denoptim.graph.Ring.getDistance(), denoptim.graph.Ring.getHeadVertex(), denoptim.graph.Ring.getPositionOf(), denoptim.graph.Ring.getSize(), denoptim.graph.Ring.getTailVertex(), denoptim.graph.Ring.getVertexAtPosition(), denoptim.graph.Ring.getVertices(), denoptim.graph.Ring.indexOf(), denoptim.graph.Ring.insertVertex(), denoptim.graph.Ring.removeVertex(), denoptim.graph.Ring.replaceVertex(), denoptim.graph.Ring.Ring(), and denoptim.graph.Ring.toString().