drasys.or.graph
Class PropertiesAdapter

java.lang.Object
  |
  +--drasys.or.graph.PropertiesAdapter
Direct Known Subclasses:
TimeWindowPropertiesAdapter

public class PropertiesAdapter
extends java.lang.Object
implements PropertiesI

A convenience object that provides default vertex properties.


Constructor Summary
PropertiesAdapter()
           
 
Method Summary
 double getConnectionCost(EdgeI inEdge, VertexI vertex, EdgeI outEdge)
          Always returns zero.
 double getConnectionTime(EdgeI inEdge, VertexI vertex, EdgeI outEdge)
          Always returns zero.
 double getEdgeCost(EdgeI edge, boolean isReverse)
          Always returns 'edge.getCost(isReverse)'.
 double getEdgeDistance(EdgeI edge, boolean isReverse)
          Always returns 'edge.getDistance(isReverse)'.
 double getEdgeTime(EdgeI edge, boolean isReverse)
          Always returns 'edge.getTime(isReverse)'.
 double getVertexCost(VertexI vertex)
          Always returns 'vertex.getTime()'.
 double[] getVertexDemand(VertexI vertex)
          Always returns 'vertex.getDemand()'.
 double getVertexTime(VertexI vertex)
          Always returns 'vertex.getCost()'.
 boolean isConnectionRestricted(EdgeI inEdge, VertexI vertex, EdgeI outEdge)
          Always returns false.
 boolean isEdgeRestricted(EdgeI edge, boolean reverse)
          Always returns false
 boolean isSymmetric()
          Always returns true;
 boolean isVertexRestricted(VertexI vertex)
          Always returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesAdapter

public PropertiesAdapter()
Method Detail

isVertexRestricted

public boolean isVertexRestricted(VertexI vertex)
Always returns false.

getVertexCost

public double getVertexCost(VertexI vertex)
Always returns 'vertex.getTime()'.

getVertexTime

public double getVertexTime(VertexI vertex)
Always returns 'vertex.getCost()'.

getVertexDemand

public double[] getVertexDemand(VertexI vertex)
Always returns 'vertex.getDemand()'.

isSymmetric

public boolean isSymmetric()
Always returns true;

isEdgeRestricted

public boolean isEdgeRestricted(EdgeI edge,
                                boolean reverse)
Always returns false
Tags copied from interface: EdgePropertiesI
Parameters:
reverse - set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getEdgeCost

public double getEdgeCost(EdgeI edge,
                          boolean isReverse)
Always returns 'edge.getCost(isReverse)'.
Tags copied from interface: EdgePropertiesI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getEdgeTime

public double getEdgeTime(EdgeI edge,
                          boolean isReverse)
Always returns 'edge.getTime(isReverse)'.
Tags copied from interface: EdgePropertiesI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getEdgeDistance

public double getEdgeDistance(EdgeI edge,
                              boolean isReverse)
Always returns 'edge.getDistance(isReverse)'.
Tags copied from interface: EdgePropertiesI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

isConnectionRestricted

public boolean isConnectionRestricted(EdgeI inEdge,
                                      VertexI vertex,
                                      EdgeI outEdge)
Always returns false.
Specified by:
isConnectionRestricted in interface PropertiesI
Tags copied from interface: PropertiesI
Parameters:
inEdge - the edge traversed to reach the vertex.
vertex - the vertex.
outEdge - the edge traversed to leave the vertex.

getConnectionCost

public double getConnectionCost(EdgeI inEdge,
                                VertexI vertex,
                                EdgeI outEdge)
Always returns zero.
Specified by:
getConnectionCost in interface PropertiesI
Tags copied from interface: PropertiesI
Parameters:
inEdge - the edge traversed to reach the vertex.
vertex - the vertex.
outEdge - the edge traversed to leave the vertex.

getConnectionTime

public double getConnectionTime(EdgeI inEdge,
                                VertexI vertex,
                                EdgeI outEdge)
Always returns zero.
Specified by:
getConnectionTime in interface PropertiesI
Tags copied from interface: PropertiesI
Parameters:
inEdge - the edge traversed to reach the vertex.
vertex - the vertex.
outEdge - the edge traversed to leave the vertex.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com