JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.graph
Class BrokenEdge

java.lang.Object
  extended bygov.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.


Field Summary
 Edge edge
           
 Vertex vertex
           
 
Constructor Summary
BrokenEdge()
           
BrokenEdge(Edge e, Vertex v)
           
 
Method Summary
 java.lang.Object clone()
           
 DirectedEdge getDirectedEdge()
           
 DirectedVertex getDirectedVertex()
           
 boolean isCompatible(Compatible c)
          are the edges compatible for merging (the associated vertex is not considered)
 boolean isLegal()
           
 BrokenEdge shallowCopyBrokenEdge()
           
 java.lang.String toString()
           
 boolean wantsInput()
          used with DirectedEdge
 boolean wantsOutput()
          used with DirectedEdge
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

edge

public Edge edge

vertex

public Vertex vertex
Constructor Detail

BrokenEdge

public BrokenEdge()

BrokenEdge

public BrokenEdge(Edge e,
                  Vertex v)
Method Detail

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()

JavaGenes, NASA Ames. Written largely by Al Globus