net.walend.measured
Class GEBellmanFordTest.BFPathMeter

java.lang.Object
  |
  +--net.walend.measured.GEBellmanFordTest.BFPathMeter
All Implemented Interfaces:
GEPathMeter
Enclosing class:
GEBellmanFordTest

private static final class GEBellmanFordTest.BFPathMeter
extends java.lang.Object
implements GEPathMeter

A special path meter for the Bellman Ford algorithm that wraps another path meter.


Field Summary
private  GEPathMeter wrapped
           
 
Constructor Summary
protected GEBellmanFordTest.BFPathMeter(GEPathMeter wrapped)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wrapped

private GEPathMeter wrapped
Constructor Detail

GEBellmanFordTest.BFPathMeter

protected GEBellmanFordTest.BFPathMeter(GEPathMeter wrapped)
Method Detail

costToCross

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

Specified by:
costToCross in interface GEPathMeter

intCostToCross

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

Specified by:
intCostToCross in interface GEPathMeter

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.

Specified by:
negativeWeightEdges in interface GEPathMeter


Copyright (c) 2001, 2002, David Walend