drasys.or.graph.vrp
Class VRPBase

java.lang.Object
  |
  +--drasys.or.graph.vrp.VRPBase
Direct Known Subclasses:
ConstructBase, ImproveBase

public abstract class VRPBase
extends java.lang.Object

A base class containing features common to many VRP algorithms.


Field Summary
protected  boolean _closed
           
protected  java.lang.Object _depotKey
           
protected  java.lang.Object _edgeKey
           
protected  GraphI _graph
           
protected  double _maxCost
           
protected  double _maxLoad
           
protected  boolean _out
           
protected  PropertiesI _properties
           
protected  double _vehicleCost
           
 
Constructor Summary
VRPBase()
           
 
Method Summary
protected static java.util.Vector[] copyTours(java.util.Vector[] tours)
           
 double getCost(VertexI from, VertexI to)
          Returns the cost of traveling between two vertices using the properties as appropriate.
 GraphI getGraph()
          Gets the graph used by the algorithm.
 double getLoad(VertexI vert)
          Returns the load at a vertex using the properties as appropriate.
protected  double[] getLoads(java.util.Vector[] tours)
           
 void setCapacityConstraint(double maxLoadPerVehicle)
          Sets the vehicle capacity constraint.
 void setCostConstraint(double maxCostPerVehicle)
          Sets the vehicle cost constraint.
 void setEdgeKey(java.lang.Object edgeKey)
          Sets the key used to select from parallel edges between vertices.
 void setGraph(GraphI graph)
          Sets the graph used by the algorithm.
 void setProperties(PropertiesI properties)
          Sets the edge properties object.
 void setVehicleCost(double vehicleCost)
          Sets the vehicle cost.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_graph

protected GraphI _graph

_closed

protected boolean _closed

_out

protected boolean _out

_edgeKey

protected java.lang.Object _edgeKey

_depotKey

protected java.lang.Object _depotKey

_vehicleCost

protected double _vehicleCost

_maxCost

protected double _maxCost

_maxLoad

protected double _maxLoad

_properties

protected PropertiesI _properties
Constructor Detail

VRPBase

public VRPBase()
Method Detail

getLoad

public double getLoad(VertexI vert)
Returns the load at a vertex using the properties as appropriate.

getCost

public double getCost(VertexI from,
                      VertexI to)
Returns the cost of traveling between two vertices using the properties as appropriate.

setGraph

public void setGraph(GraphI graph)
Sets the graph used by the algorithm.

getGraph

public GraphI getGraph()
Gets the graph used by the algorithm.

setVehicleCost

public void setVehicleCost(double vehicleCost)
Sets the vehicle cost. Must be the same units as the edge traversal costs.

setCostConstraint

public void setCostConstraint(double maxCostPerVehicle)
Sets the vehicle cost constraint.

setCapacityConstraint

public void setCapacityConstraint(double maxLoadPerVehicle)
Sets the vehicle capacity constraint.

setProperties

public void setProperties(PropertiesI properties)
Sets the edge properties object.

setEdgeKey

public void setEdgeKey(java.lang.Object edgeKey)
Sets the key used to select from parallel edges between vertices. The default value for 'edgeKey' is null.

copyTours

protected static java.util.Vector[] copyTours(java.util.Vector[] tours)

getLoads

protected double[] getLoads(java.util.Vector[] tours)
                     throws SolutionNotFoundException


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