|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--drasys.or.graph.tsp.Composite
This class implements a composite TSP algorithm by combining a construction algorithm with an improvement algorithm. A composite TSP algorithm is one that has a construction phase followed by an improvement phase. In the TSP package all basic algorithms are implemented as either a pure construction or improvement class with the associated interface. This class implements the composite algorithm by constructing an initial tour using the construction algorithm and then improving it with the improvement algorithm.
Constructor Summary | |
Composite(ConstructI construct,
ImproveI improve)
|
|
Composite(ConstructI construct,
ImproveI improve,
GraphI graph)
|
Method Summary | |
double |
constructClosedTour()
Construct a closed tour solution. |
double |
constructOpenTour()
Construct an open tour solution with arbitrary end points. |
double |
constructOpenTour(java.lang.Object originKey,
java.lang.Object destinationKey)
Construct a tour with explicit end points. |
double |
constructOpenTourFrom(java.lang.Object originKey)
Construct an open tour solution with an explicit origin and arbitrary destination. |
double |
constructOpenTourTo(java.lang.Object destinationKey)
Construct an open tour solution with an explicit destination and arbitrary origin. |
ConstructI |
getConstructAlgorithm()
|
double |
getCost()
Returns the cost of the solution tour. |
ImproveI |
getImproveAlgorithm()
|
java.util.Vector |
getTour()
Returns the solution tour. |
java.util.Vector |
rotateClosedTour(java.util.Vector tour,
java.lang.Object key)
Rotates the closed tour until the vertex that matches key is the vertex that is repeated on both ends. |
void |
selectVertex(boolean select)
Selects all of the vertices in the graph to be in the tour if 'select' is true. |
void |
selectVertex(boolean[] select)
Selects all of the vertices whose corresponding element in 'select' is true. |
void |
selectVertex(java.lang.Object key,
boolean select)
Selects the vertex to be in the tour if 'select' is true. |
void |
setEdgeKey(java.lang.Object edgeKey)
Sets the edge key for the construction and improvement algorithms. |
void |
setGraph(GraphI graph)
Sets the graph for the construction and improvement algorithms. |
void |
setProperties(PropertiesI properties)
Sets the edge properties object for the construction and improvement algorithms. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Composite(ConstructI construct, ImproveI improve)
public Composite(ConstructI construct, ImproveI improve, GraphI graph)
Method Detail |
public ConstructI getConstructAlgorithm()
public ImproveI getImproveAlgorithm()
public void setGraph(GraphI graph)
public void setProperties(PropertiesI properties)
public void setEdgeKey(java.lang.Object edgeKey)
public double getCost()
public java.util.Vector getTour()
public double constructOpenTour(java.lang.Object originKey, java.lang.Object destinationKey) throws TourNotFoundException, VertexNotFoundException
public double constructOpenTourFrom(java.lang.Object originKey) throws TourNotFoundException, VertexNotFoundException
public double constructOpenTourTo(java.lang.Object destinationKey) throws TourNotFoundException, VertexNotFoundException
public double constructOpenTour() throws TourNotFoundException
public double constructClosedTour() throws TourNotFoundException
public void selectVertex(boolean[] select)
public void selectVertex(boolean select)
public void selectVertex(java.lang.Object key, boolean select) throws VertexNotFoundException
public java.util.Vector rotateClosedTour(java.util.Vector tour, java.lang.Object key) throws VertexNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |