22 #ifndef CHRouterWrapper_h 23 #define CHRouterWrapper_h 67 template<
class E,
class V,
class PF>
95 void compute(
const E* from,
const E* to,
const V*
const vehicle,
96 SUMOTime msTime, std::vector<const E*>& into) {
97 const std::pair<const SUMOVehicleClass, const SUMOReal> svc = std::make_pair(vehicle->getVClass(), vehicle->getMaxSpeed());
104 myRouters[svc]->compute(from, to, vehicle, msTime, into);
109 const V*
const v,
SUMOTime msTime)
const {
112 for (
typename std::vector<const E*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
113 if (PF::operator()(*i, v)) {
114 WRITE_WARNING(
"Vehicle '" + v->getID() +
"' is restricted from using its assigned route.");
117 costs += this->
getEffort(*i, v, time + costs);
125 typedef std::map<std::pair<const SUMOVehicleClass, const SUMOReal>, CHRouterType*>
RouterMap;
Computes the shortest path through a contracted network.
std::map< std::pair< const SUMOVehicleClass, const SUMOReal >, CHRouterType * > RouterMap
#define WRITE_WARNING(msg)
CHRouterWrapper(size_t dictSize, bool ignoreErrors, Operation operation, SUMOTime begin, SUMOTime weightPeriod)
Constructor.
virtual SUMOAbstractRouter< E, V > * clone() const
SUMOReal(* Operation)(const E *const, const V *const, SUMOReal)
Type of the function that is used to retrieve the edge effort.
Operation myOperation
The object's operation to perform.
size_t myDictSize
number of edges with numerical id
CHRouter< E, V, noProhibitions< E, V > > CHRouterType
SUMOReal getEffort(const E *const e, const V *const v, SUMOReal t) const
SUMOReal recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const
void compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into)
Builds the route between the given edges using the minimum effort at the given time The definition of...
Computes the shortest path through a contracted network.