net.walend.measured
Interface GEPathMeter

All Known Implementing Classes:
GEBellmanFordTest.BFPathMeter, ShortestGEDistancesTest.ScaleUpGEPathMeter, ShortestGEDistancesTest.ShortGEPathMeter, ShortestGEPathTest.ScaleUpGEPathMeter, ShortestGEPathTest.ShortGEPathMeter, SimpleGEPathMeter, TestGEPathMeter

public interface GEPathMeter

PathMeters measure the cost to enter and leave nodes and cross edges. These are most often used by other algorithms to find the cost of travelling a specific CEPath. Write one of these and feed it to the algorithm with the path or directed graph.

If a method receives an argument that it can not evaluate, throw an IllegalArgumentException. If your GEPathMeter really only works with doubles and converting to an int makes no sense, throw an UnsupportedOperationException where the method returns an int. Else, describe what rounding rules you are using.

Author:
David Walend dfw1@cornell.edu

Method Summary
 double costToCross(java.lang.Object fromNode, java.lang.Object toNode)
          The cost to cross an edge.
 int intCostToCross(java.lang.Object fromNode, java.lang.Object toNode)
          The cost to cross an edge.
 boolean negativeWeightEdges()
          Returns true if this PathMeter can return negative weight edges, false if not.
 

Method Detail

costToCross

public double costToCross(java.lang.Object fromNode,
                          java.lang.Object toNode)
The cost to cross an edge.


intCostToCross

public int intCostToCross(java.lang.Object fromNode,
                          java.lang.Object toNode)
The cost to cross an edge.


negativeWeightEdges

public boolean negativeWeightEdges()
Returns true if this PathMeter can return negative weight edges, false if not. Shortest path algorithms use this method to trigger the bellman-ford algorithm to detect negative weight cycles. If you're not sure, return true.



Copyright (c) 2001, 2002, David Walend