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);
198 const unsigned int length_size = minEdge->getNumPredecessors();
199 for (i = 0; i < length_size; i++) {
200 const E*
const follower = minEdge->getPredecessor(i);
203 if (!followerInfo->
visited && traveltime < oldEffort) {
207 followerInfo->
prev = minimumInfo;
239 for (
typename std::vector<EdgeInfo*>::iterator i =
myFrontier.begin(); i !=
myFrontier.end(); i++) {
243 for (
typename std::vector<EdgeInfo*>::iterator i =
myFound.begin(); i !=
myFound.end(); i++) {
251 void compute(
const E* from,
const E* to,
const V*
const vehicle,
252 SUMOTime msTime, std::vector<const E*>& into) {
253 assert(from != 0 && to != 0);
270 const E*
const minEdge = minimumInfo->
edge;
273 myFound.push_back(minimumInfo);
286 const unsigned int length_size = minEdge->getNumSuccessors();
287 for (i = 0; i < length_size; i++) {
288 const E*
const follower = minEdge->getSuccessor(i);
291 if (PF::operator()(follower, vehicle)) {
295 if (!followerInfo->
visited && traveltime < oldEffort) {
302 heuristic_remaining = minEdge->getDistanceTo(to) / vehicle->getMaxSpeed();
310 heuristic_remaining =
MAX2(
312 minEdge->getDistanceTo(to) / vehicle->getMaxSpeed());
315 followerInfo->
heuristicTime = traveltime + heuristic_remaining;
316 followerInfo->
prev = minimumInfo;
336 for (
typename std::vector<const E*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
337 if (PF::operator()(*i, v)) {
340 costs += this->
getEffort(*i, v, time + costs);
348 std::deque<const E*> tmp;
349 while (rbegin != 0) {
350 tmp.push_front((E*) rbegin->
edge);
351 rbegin = rbegin->
prev;
353 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.
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 recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const
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.
SUMOReal(* Operation)(const E *const, const V *const, SUMOReal)
Type of the function that is used to retrieve the edge effort.
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(E::* MinTTOperation)(const V *const) const
SUMOReal getEffort(const E *const e, const V *const v, SUMOReal t) const
EdgeInfoComparator myComparator