TraCIDijkstraRouter< E >::EdgeInfoCont Class Reference

#include <TraCIDijkstraRouter.h>


Detailed Description

template<class E>
class TraCIDijkstraRouter< E >::EdgeInfoCont

A class holding the instances of effort-to-reach and predeccessor information for every edge within the network. This class is used instead of the former saving of these values within the edges to allow parallel route computation in multithreading mode.

Definition at line 233 of file TraCIDijkstraRouter.h.


Public Member Functions

EdgeInfoadd (const E *edgeArg, SUMOReal effortArg, EdgeInfo *prevArg, SUMOReal distArg)
 Adds the information about the effort to get to an edge and its predeccessing edge.
EdgeInfoadd (const E *edgeArg, SUMOReal effortArg, EdgeInfo *prevArg)
 Adds the information about the effort to get to an edge and its predeccessing edge.
 EdgeInfoCont (size_t toAlloc)
 Constructor.
SUMOReal getEffort (const E *to) const
 Returns the effort to get to the specify edge The value is valid if the edge was already visited.
void reset ()
 Resets all effort-information.
 ~EdgeInfoCont ()
 Destructor.

Private Attributes

std::vector< EdgeInfomyEdgeInfos
 The container of edge information.

Constructor & Destructor Documentation

template<class E>
TraCIDijkstraRouter< E >::EdgeInfoCont::EdgeInfoCont ( size_t  toAlloc  )  [inline]

Constructor.

Definition at line 236 of file TraCIDijkstraRouter.h.

00237                 : myEdgeInfos(toAlloc+1, EdgeInfo()) { }

template<class E>
TraCIDijkstraRouter< E >::EdgeInfoCont::~EdgeInfoCont (  )  [inline]

Destructor.

Definition at line 240 of file TraCIDijkstraRouter.h.

00240 { }


Member Function Documentation

template<class E>
EdgeInfo* TraCIDijkstraRouter< E >::EdgeInfoCont::add ( const E *  edgeArg,
SUMOReal  effortArg,
EdgeInfo prevArg,
SUMOReal  distArg 
) [inline]

Adds the information about the effort to get to an edge and its predeccessing edge.

Definition at line 253 of file TraCIDijkstraRouter.h.

References TraCIDijkstraRouter< E >::EdgeInfo::dist, TraCIDijkstraRouter< E >::EdgeInfo::edge, TraCIDijkstraRouter< E >::EdgeInfo::effort, TraCIDijkstraRouter< E >::EdgeInfoCont::myEdgeInfos, and TraCIDijkstraRouter< E >::EdgeInfo::prev.

00254                                         {
00255             EdgeInfo *ret = &(myEdgeInfos[edgeArg->getNumericalID()]);
00256             ret->edge = edgeArg; // !!! may be set within the constructor
00257             ret->effort = effortArg;
00258             ret->prev = prevArg;
00259             ret->dist = distArg;
00260             return ret;
00261         }

template<class E>
EdgeInfo* TraCIDijkstraRouter< E >::EdgeInfoCont::add ( const E *  edgeArg,
SUMOReal  effortArg,
EdgeInfo prevArg 
) [inline]

Adds the information about the effort to get to an edge and its predeccessing edge.

Definition at line 243 of file TraCIDijkstraRouter.h.

References TraCIDijkstraRouter< E >::EdgeInfo::dist, TraCIDijkstraRouter< E >::EdgeInfo::edge, TraCIDijkstraRouter< E >::EdgeInfo::effort, TraCIDijkstraRouter< E >::EdgeInfoCont::myEdgeInfos, and TraCIDijkstraRouter< E >::EdgeInfo::prev.

Referenced by TraCIDijkstraRouter< E >::compute().

00243                                                                                {
00244             EdgeInfo *ret = &(myEdgeInfos[edgeArg->getNumericalID()]);
00245             ret->edge = edgeArg; // !!! may be set within the constructor
00246             ret->effort = effortArg;
00247             ret->prev = prevArg;
00248             ret->dist = 0;
00249             return ret;
00250         }

template<class E>
SUMOReal TraCIDijkstraRouter< E >::EdgeInfoCont::getEffort ( const E *  to  )  const [inline]

Returns the effort to get to the specify edge The value is valid if the edge was already visited.

Definition at line 273 of file TraCIDijkstraRouter.h.

References TraCIDijkstraRouter< E >::EdgeInfoCont::myEdgeInfos.

Referenced by TraCIDijkstraRouter< E >::compute().

00273                                               {
00274             return myEdgeInfos[to->getNumericalID()].effort;
00275         }

template<class E>
void TraCIDijkstraRouter< E >::EdgeInfoCont::reset (  )  [inline]

Resets all effort-information.

Definition at line 264 of file TraCIDijkstraRouter.h.

References max, and TraCIDijkstraRouter< E >::EdgeInfoCont::myEdgeInfos.

Referenced by TraCIDijkstraRouter< E >::compute().

00264                      {
00265             for (typename std::vector<EdgeInfo>::iterator i=myEdgeInfos.begin(); i!=myEdgeInfos.end(); i++) {
00266                 (*i).effort = std::numeric_limits<SUMOReal>::max();
00267             }
00268         }


Field Documentation

template<class E>
std::vector<EdgeInfo> TraCIDijkstraRouter< E >::EdgeInfoCont::myEdgeInfos [private]


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

Generated on Wed May 5 00:07:01 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6