$darkmode
DENOPTIM
|
This class represents the edge between two vertices. More...
Classes | |
enum | BondType |
Possible chemical bond types an edge can represent. More... | |
class | DENOPTIMEdgeSerializer |
Public Member Functions | |
Edge (AttachmentPoint srcAP, AttachmentPoint trgAP, BondType bondType) | |
Constructor for an edge that connects two APs. More... | |
Edge (AttachmentPoint srcAP, AttachmentPoint trgAP) | |
Constructor for an edge that connects two APs. More... | |
AttachmentPoint | getSrcAP () |
AttachmentPoint | getSrcAPThroughout () |
AttachmentPoint | getTrgAPThroughout () |
AttachmentPoint | getTrgAP () |
long | getSrcVertex () |
int | getSrcAPID () |
int | getTrgAPID () |
long | getTrgVertex () |
APClass | getSrcAPClass () |
APClass | getTrgAPClass () |
BondType | getBondType () |
boolean | sameAs (Edge other, StringBuilder reason) |
Compares this and another edge ignoring edge and vertex IDs. More... | |
int | compareAsUndirected (Edge other) |
Compares this and another edge ignoring the directionality of both, i.e., as if both edges were undirected. More... | |
String | toString () |
void | flipEdge () |
Exchanges source and target vertices and respective APs of this edge. More... | |
Private Attributes | |
AttachmentPoint | srcAP |
Attachment point at source end. More... | |
AttachmentPoint | trgAP |
Attachment point at target end. More... | |
BondType | bondType = BondType.UNDEFINED |
The bond type associated with the connection between the fragments. More... | |
denoptim.graph.Edge.Edge | ( | AttachmentPoint | srcAP, |
AttachmentPoint | trgAP, | ||
BondType | bondType | ||
) |
Constructor for an edge that connects two APs.
The number of connections available in the APs is reduced upon creation of the edge and according the the bond type.
srcAP | attachment point at source end |
trgAP | attachment point at target end |
bondType | defines what kind of bond type this edge should be converted to when converting a graph into a chemical representation. |
Definition at line 67 of file Edge.java.
References denoptim.graph.Edge.bondType, denoptim.graph.AttachmentPoint.setUser(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.
denoptim.graph.Edge.Edge | ( | AttachmentPoint | srcAP, |
AttachmentPoint | trgAP | ||
) |
Constructor for an edge that connects two APs.
We assume a single bond. The number of connections available in the APs is reduced upon creation of the edge and according the the bond type.
srcAP | attachment point at source end |
trgAP | attachment point at target end |
Definition at line 87 of file Edge.java.
References denoptim.graph.Edge.srcAP, denoptim.graph.Edge.trgAP, and denoptim.graph.Edge.BondType.UNDEFINED.
int denoptim.graph.Edge.compareAsUndirected | ( | Edge | other | ) |
Compares this and another edge ignoring the directionality of both, i.e., as if both edges were undirected.
Ranking and comparison is based on an invariant lexicographic string that combines, for each side of the edge, the following information:
Only for edges that link equivalent building blocks via the corresponding APs (i.e., edges belonging to the same invariant class), the bond type is considered as the final comparison criterion.
other | edge to compare with this. |
Definition at line 221 of file Edge.java.
References denoptim.graph.Edge.getBondType(), denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.AttachmentPoint.getIndexInOwner(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.EdgeTest.testUndirectedComparison().
void denoptim.graph.Edge.flipEdge | ( | ) |
Exchanges source and target vertices and respective APs of this edge.
Definition at line 292 of file Edge.java.
References denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.DGraph.fixEdgeDirections().
BondType denoptim.graph.Edge.getBondType | ( | ) |
Definition at line 164 of file Edge.java.
References denoptim.graph.Edge.bondType.
Referenced by denoptim.graph.rings.RingSizeManager.addRingClosingBond(), denoptim.graph.Edge.compareAsUndirected(), denoptim.graph.DGraph.editGraph(), denoptim.graph.rings.RandomCombOfRingsIterator.next(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.Edge.sameAs(), and denoptim.graph.Edge.DENOPTIMEdgeSerializer.serialize().
AttachmentPoint denoptim.graph.Edge.getSrcAP | ( | ) |
Definition at line 94 of file Edge.java.
References denoptim.graph.Edge.srcAP.
Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.AttachmentPointTest.checkGetEdgeUserThroughput(), denoptim.ga.GraphOperations.extendLink(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.Edge.flipEdge(), denoptim.graph.DGraph.getAPOnLeftVertexID(), denoptim.graph.Vertex.getChilddren(), denoptim.utils.GraphConversionTool.getJGraphFromGraph(), denoptim.graph.AttachmentPoint.getLinkedAP(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.Vertex.getParent(), denoptim.graph.DGraph.getParent(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.AttachmentPoint.isSrcInUser(), denoptim.graph.AttachmentPoint.isSrcInUserThroughout(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeEdge(), denoptim.graph.Edge.sameAs(), denoptim.graph.Edge.DENOPTIMEdgeSerializer.serialize(), and denoptim.graph.EdgeTest.testConnectionDeconnectionLoop().
APClass denoptim.graph.Edge.getSrcAPClass | ( | ) |
Definition at line 150 of file Edge.java.
References denoptim.graph.AttachmentPoint.getAPClass(), and denoptim.graph.Edge.srcAP.
Referenced by denoptim.graph.rings.RingSizeManager.evaluateRCVPair(), and denoptim.ga.GraphOperations.isCrossoverPossible().
int denoptim.graph.Edge.getSrcAPID | ( | ) |
Definition at line 129 of file Edge.java.
References denoptim.graph.Vertex.getIndexOfAP(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Edge.srcAP.
Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.rings.RingSizeManager.evaluateRCVPair(), denoptim.graph.DGraph.getBondingAPIndex(), denoptim.ga.GraphOperations.getFragmentForClosableChain(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), and denoptim.graph.Edge.toString().
AttachmentPoint denoptim.graph.Edge.getSrcAPThroughout | ( | ) |
Definition at line 101 of file Edge.java.
References denoptim.graph.AttachmentPoint.getEmbeddedAP(), and denoptim.graph.Edge.srcAP.
Referenced by denoptim.graph.Vertex.getAPsFromChildren(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.isSrcInUserThroughout(), and denoptim.graph.AttachmentPointTest.testGetEmbeddedAP().
long denoptim.graph.Edge.getSrcVertex | ( | ) |
Definition at line 122 of file Edge.java.
References denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.Edge.srcAP.
Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.getBondingAPIndex(), denoptim.graph.DGraph.getEdgesWithChild(), denoptim.graph.DGraph.getIndexOfEdgesWithChild(), denoptim.ga.GraphOperations.rebuildBranch(), and denoptim.graph.DGraph.removeVertex().
AttachmentPoint denoptim.graph.Edge.getTrgAP | ( | ) |
Definition at line 115 of file Edge.java.
References denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.graph.AttachmentPointTest.checkGetEdgeUserThroughput(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.Edge.flipEdge(), denoptim.graph.DGraph.getAPOnLeftVertexID(), denoptim.graph.Vertex.getChilddren(), denoptim.graph.Vertex.getChildrenThroughout(), denoptim.graph.Vertex.getEdgeToParent(), denoptim.graph.AttachmentPoint.getLinkedAP(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.Vertex.getParent(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeEdge(), denoptim.graph.Edge.sameAs(), denoptim.graph.Edge.DENOPTIMEdgeSerializer.serialize(), and denoptim.graph.EdgeTest.testConnectionDeconnectionLoop().
APClass denoptim.graph.Edge.getTrgAPClass | ( | ) |
Definition at line 157 of file Edge.java.
References denoptim.graph.AttachmentPoint.getAPClass(), and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), and denoptim.ga.GraphOperations.isCrossoverPossible().
int denoptim.graph.Edge.getTrgAPID | ( | ) |
Definition at line 136 of file Edge.java.
References denoptim.graph.Vertex.getIndexOfAP(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.DGraph.getBondingAPIndex(), denoptim.ga.GraphOperations.getFragmentForClosableChain(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), and denoptim.graph.Edge.toString().
AttachmentPoint denoptim.graph.Edge.getTrgAPThroughout | ( | ) |
Definition at line 108 of file Edge.java.
References denoptim.graph.AttachmentPoint.getEmbeddedAP(), and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.Vertex.getAPsFromChildren(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), and denoptim.graph.AttachmentPointTest.testGetEmbeddedAP().
long denoptim.graph.Edge.getTrgVertex | ( | ) |
Definition at line 143 of file Edge.java.
References denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.Edge.trgAP.
Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.DGraph.compareGraphNodes(), denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.getBondingAPIndex(), and denoptim.graph.DGraph.removeVertex().
boolean denoptim.graph.Edge.sameAs | ( | Edge | other, |
StringBuilder | reason | ||
) |
Compares this and another edge ignoring edge and vertex IDs.
other | edge to compare against |
reason | string builder used to build the message clarifying the reason for returning false . |
true
if the two edges represent the same connection even if the vertex IDs are different. Definition at line 180 of file Edge.java.
References denoptim.graph.Edge.getBondType(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), and denoptim.graph.Edge.sameAs().
Referenced by denoptim.graph.Edge.sameAs(), denoptim.graph.EdgeTest.testSameAs_DiffBndTyp(), and denoptim.graph.EdgeTest.testSameAs_Equal().
String denoptim.graph.Edge.toString | ( | ) |
Definition at line 265 of file Edge.java.
References denoptim.graph.Edge.bondType, denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Edge.getSrcAPID(), denoptim.graph.Edge.getTrgAPID(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.
|
private |
The bond type associated with the connection between the fragments.
Definition at line 52 of file Edge.java.
Referenced by denoptim.graph.Edge.Edge(), denoptim.graph.Edge.getBondType(), and denoptim.graph.Edge.toString().
|
private |
Attachment point at source end.
Definition at line 42 of file Edge.java.
Referenced by denoptim.graph.Edge.compareAsUndirected(), denoptim.graph.Edge.Edge(), denoptim.graph.Edge.flipEdge(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getSrcAPClass(), denoptim.graph.Edge.getSrcAPID(), denoptim.graph.Edge.getSrcAPThroughout(), denoptim.graph.Edge.getSrcVertex(), and denoptim.graph.Edge.toString().
|
private |
Attachment point at target end.
Definition at line 47 of file Edge.java.
Referenced by denoptim.graph.Edge.compareAsUndirected(), denoptim.graph.Edge.Edge(), denoptim.graph.Edge.flipEdge(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Edge.getTrgAPClass(), denoptim.graph.Edge.getTrgAPID(), denoptim.graph.Edge.getTrgAPThroughout(), denoptim.graph.Edge.getTrgVertex(), and denoptim.graph.Edge.toString().