rails.algorithms
Class RevenueTrainRun

java.lang.Object
  extended by rails.algorithms.RevenueTrainRun
All Implemented Interfaces:
java.lang.Comparable<RevenueTrainRun>

public class RevenueTrainRun
extends java.lang.Object
implements java.lang.Comparable<RevenueTrainRun>

Links the results from the revenue calculator to the rails program Each object defines the run of one train


Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
RevenueTrainRun(RevenueAdapter revenueAdapter, NetworkTrain train)
           
 
Method Summary
(package private)  void addEdge(NetworkEdge edge)
           
(package private)  void addVertex(NetworkVertex vertex)
           
 int compareTo(RevenueTrainRun other)
           
(package private)  void convertEdgesToVertices()
          defines the vertices from the list of edges
(package private)  void convertVerticesToEdges()
          defines the edges from the list of vertices
(package private)  java.awt.geom.GeneralPath getAsPath(HexMap map)
           
 NetworkVertex getFirstVertex()
          returns the first vertex of a train run
 NetworkVertex getLastVertex()
          returns the last vertex of a train run
 int getRunValue()
           
 java.util.List<NetworkVertex> getRunVertices()
           
 NetworkTrain getTrain()
           
 java.util.Set<NetworkVertex> getUniqueVertices()
           
 boolean hasAValidRun()
          returns true if train has a valid run (at least two vertices)
(package private)  boolean hasButtomRun()
           
(package private)  java.lang.String prettyPrint(boolean includeDetails)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
Constructor Detail

RevenueTrainRun

RevenueTrainRun(RevenueAdapter revenueAdapter,
                NetworkTrain train)
Method Detail

getRunVertices

public java.util.List<NetworkVertex> getRunVertices()

hasAValidRun

public boolean hasAValidRun()
returns true if train has a valid run (at least two vertices)


getFirstVertex

public NetworkVertex getFirstVertex()
returns the first vertex of a train run


getLastVertex

public NetworkVertex getLastVertex()
returns the last vertex of a train run


getUniqueVertices

public java.util.Set<NetworkVertex> getUniqueVertices()

getTrain

public NetworkTrain getTrain()

getRunValue

public int getRunValue()

hasButtomRun

boolean hasButtomRun()

addVertex

void addVertex(NetworkVertex vertex)

addEdge

void addEdge(NetworkEdge edge)

convertEdgesToVertices

void convertEdgesToVertices()
defines the vertices from the list of edges


convertVerticesToEdges

void convertVerticesToEdges()
defines the edges from the list of vertices


prettyPrint

java.lang.String prettyPrint(boolean includeDetails)

getAsPath

java.awt.geom.GeneralPath getAsPath(HexMap map)

compareTo

public int compareTo(RevenueTrainRun other)
Specified by:
compareTo in interface java.lang.Comparable<RevenueTrainRun>