gov.nasa.javaGenes.graph
Class BrokenEdge
java.lang.Object
gov.nasa.javaGenes.graph.BrokenEdge
- All Implemented Interfaces:
- java.lang.Cloneable, Compatible
- public class BrokenEdge
- extends java.lang.Object
- implements java.lang.Cloneable, Compatible
When an edge is cut during crossover, this class is used to remember the
cut edge and the vertex it is associated with. Two BrokenEdge objects
are created for each edge cut, one for each part of the graph being torn in
two. These sub-graphs are represented by BrokenGraph objects. The associated vertex is
different for each BrokenEdge object depending
on which BrokenGraph the broken edge goes with.
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
edge
public Edge edge
vertex
public Vertex vertex
BrokenEdge
public BrokenEdge()
BrokenEdge
public BrokenEdge(Edge e,
Vertex v)
shallowCopyBrokenEdge
public BrokenEdge shallowCopyBrokenEdge()
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Throws:
java.lang.CloneNotSupportedException
getDirectedVertex
public DirectedVertex getDirectedVertex()
getDirectedEdge
public DirectedEdge getDirectedEdge()
wantsInput
public boolean wantsInput()
- used with DirectedEdge
- Returns:
- true if this broken edge requires input from a new vertex
wantsOutput
public boolean wantsOutput()
- used with DirectedEdge
- Returns:
- true if this broken edge requires output to a new vertex
isCompatible
public boolean isCompatible(Compatible c)
- are the edges compatible for merging (the associated vertex is not considered)
- Specified by:
isCompatible
in interface Compatible
toString
public java.lang.String toString()
isLegal
public boolean isLegal()