29 #ifndef BulkStarRouter_h
30 #define BulkStarRouter_h
73 template<
class E,
class V,
class PF>
88 for (
size_t i = 0; i < noE; i++) {
109 edge(E::dictionary(id)),
150 return nod1->
edge->getNumericalID() > nod2->
edge->getNumericalID();
167 void prepare(
const E* destination,
const V* fastestVehicle,
bool skip) {
175 (*i).minRemaining = 0;
190 const E*
const minEdge = minimumInfo->
edge;
193 myFound.push_back(minimumInfo);
197 for (
typename std::vector<E*>::const_iterator it = minEdge->getPredecessors().begin(); it != minEdge->getPredecessors().end(); it++) {
198 const E*
const follower = *it;
201 if (!followerInfo->
visited && traveltime < oldEffort) {
205 followerInfo->
prev = minimumInfo;
237 for (
typename std::vector<EdgeInfo*>::iterator i =
myFrontier.begin(); i !=
myFrontier.end(); i++) {
241 for (
typename std::vector<EdgeInfo*>::iterator i =
myFound.begin(); i !=
myFound.end(); i++) {
249 void compute(
const E* from,
const E* to,
const V*
const vehicle,
250 SUMOTime msTime, std::vector<const E*>& into) {
251 assert(from != 0 && to != 0);
269 const E*
const minEdge = minimumInfo->
edge;
272 myFound.push_back(minimumInfo);
284 const std::vector<E*>& successors = minEdge->getSuccessors(vClass);
285 for (
typename std::vector<E*>::const_iterator it = successors.begin(); it != successors.end(); ++it) {
286 const E*
const follower = *it;
289 if (PF::operator()(follower, vehicle)) {
293 if (!followerInfo->
visited && traveltime < oldEffort) {
300 heuristic_remaining = minEdge->getDistanceTo(to) / vehicle->getMaxSpeed();
308 heuristic_remaining =
MAX2(
310 minEdge->getDistanceTo(to) / vehicle->getMaxSpeed());
313 followerInfo->
heuristicTime = traveltime + heuristic_remaining;
314 followerInfo->
prev = minimumInfo;
334 for (
typename std::vector<const E*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
335 if (PF::operator()(*i, v)) {
338 costs += this->
getEffort(*i, v, time + costs);
346 std::deque<const E*> tmp;
347 while (rbegin != 0) {
348 tmp.push_front((E*) rbegin->
edge);
349 rbegin = rbegin->
prev;
351 std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges));
MinTTOperation myMinTTOperation
std::vector< EdgeInfo * > myFound
list of visited Edges (for resetting)
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
const E * edge
The current edge.
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 travel time.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
EdgeInfo * prev
The previous edge.
void prepare(const E *destination, const V *fastestVehicle, bool skip)
Builds a complete shorteset path tree in the (static) reverse graph from destination (Dijkstra until ...
SUMOReal(E::* MinTTOperation)(const V *const) const
SUMOReal recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const
SUMOReal(* Operation)(const E *const, const V *const, SUMOReal)
Type of the function that is used to retrieve the edge effort.
MsgHandler *const myErrorMsgHandler
the handler for routing errors
SUMOReal minRemaining
minimum time to destination
const E * myPreparedDestination
bool visited
The previous edge.
bool operator()(const EdgeInfo *nod1, const EdgeInfo *nod2) const
Comparing method.
Operation myOperation
The object's operation to perform.
virtual ~BulkStarRouter()
Destructor.
void buildPathFrom(EdgeInfo *rbegin, std::vector< const E * > &edges)
Builds the path from marked edges.
SUMOReal traveltime
Effort to reach the edge.
BulkStarRouter(size_t noE, bool unbuildIsWarning, Operation operation, MinTTOperation minTTOperation)
Constructor.
std::vector< EdgeInfo * > myFrontier
A container for reusage of the min edge heap.
virtual SUMOAbstractRouter< E, V > * clone() const
void inform(std::string msg, bool addType=true)
adds a new error to the list
EdgeInfo(size_t id)
Constructor.
std::vector< EdgeInfo > myEdgeInfos
The container of edge information.
SUMOReal getMinEffort(const E *const e, const V *const v) const
SUMOReal heuristicTime
Estimated time to reach the edge (traveltime + lower bound on remaining time)
void endQuery(int visits)
SUMOReal getEffort(const E *const e, const V *const v, SUMOReal t) const
EdgeInfoComparator myComparator
vehicles ignoring classes