Sparksee  6.0.2
SinglePairShortestPathDijkstraDynamicCost Class Referenceabstract

Defines how to calculate an edge weight. More...

Public Member Functions

virtual ~SinglePairShortestPathDijkstraDynamicCost ()
 Destructor.
 
virtual sparksee::gdb::double64_t CalculateEdgeCost (sparksee::gdb::oid_t sourceNode, sparksee::gdb::double64_t sourceCost, sparksee::gdb::int32_t sourceLevel, sparksee::gdb::oid_t targetNode, sparksee::gdb::oid_t edge, sparksee::gdb::attr_t edgeWeightAttr)=0
 Dynamic calculation of an edge weight. More...
 

Detailed Description

Defines how to calculate an edge weight.

This is an interface which must be implemented by the user. While the algorithm is running, one or more calls for each edge that can be in the shortest path will be issued to get the weight of the edge that could change based on the predecessor node and the current minimum path from the source.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

virtual sparksee::gdb::double64_t SinglePairShortestPathDijkstraDynamicCost::CalculateEdgeCost ( sparksee::gdb::oid_t  sourceNode,
sparksee::gdb::double64_t  sourceCost,
sparksee::gdb::int32_t  sourceLevel,
sparksee::gdb::oid_t  targetNode,
sparksee::gdb::oid_t  edge,
sparksee::gdb::attr_t  edgeWeightAttr 
)
pure virtual

Dynamic calculation of an edge weight.

This method will be called several times during the algorithm execution. It can be called for the same edge multiple times because the path to the source node (and as a consequence the source weight and levels) might change while the algorithm is running. This method will have the normal default implementation that only uses the specified edge attribute to get the weight or the unweighted edge cost if the edge doesn't have the specified cost attribute. But it can be overriden in a derived user class to implement a dinamic edge weight, that may need the sourceCost and sourceLevels to calculate the weight.

Parameters
sourceNode[in] The current node
sourceCost[in] Current total cost up to the source node
sourceLevel[in] Current path size up to the source node
targetNode[in] The next node
edge[in] The edge to the next node that this methos must weight
edgeWeightAttr[in] The attribute that stores the edge weight or InvalidAttribute
Returns
Returns the current weight of the edge (>=0) or <0 if the edge can not be used.

The documentation for this class was generated from the following file: