 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
16 #ifndef PedestrianRouter_h
17 #define PedestrianRouter_h
46 template<
class E,
class L,
class N,
class V>
84 double compute(
const E* from,
const E* to,
double departPos,
double arrivalPos,
double speed,
85 SUMOTime msTime,
const N* onlyNode, std::vector<const E*>& into,
bool allEdges =
false) {
86 if (getSidewalk<E, L>(from) == 0) {
87 WRITE_WARNING(
"Departure edge '" + from->getID() +
"' does not allow pedestrians.");
90 if (getSidewalk<E, L>(to) == 0) {
91 WRITE_WARNING(
"Destination edge '" + to->getID() +
"' does not allow pedestrians.");
94 _IntermodalTrip trip(from, to, departPos, arrivalPos, speed, msTime, onlyNode);
95 std::vector<const _IntermodalEdge*> intoPed;
98 &trip, msTime, intoPed);
102 if (pedEdge->includeInRoute(allEdges)) {
103 into.push_back(pedEdge->getEdge());
108 #ifdef PedestrianRouter_DEBUG_ROUTES
109 std::cout <<
TIME2STEPS(msTime) <<
" trip from " << from->getID() <<
" to " << to->getID()
110 <<
" departPos=" << departPos
111 <<
" arrivalPos=" << arrivalPos
112 <<
" onlyNode=" << (onlyNode == 0 ?
"NULL" : onlyNode->getID())
114 <<
" resultEdges=" <<
toString(into)
118 return success ? time : -1.;
124 SUMOTime, std::vector<const E*>&,
bool) {
129 std::vector<_IntermodalEdge*> toProhibitPE;
130 for (
typename std::vector<E*>::const_iterator it = toProhibit.begin(); it != toProhibit.end(); ++it) {
#define WRITE_WARNING(msg)
PedestrianRouter()
Constructor.
double compute(const E *from, const E *to, double departPos, double arrivalPos, double speed, SUMOTime msTime, const N *onlyNode, std::vector< const E * > &into, bool allEdges=false)
Builds the route between the given edges using the minimum effort at the given time The definition of...
PedestrianRouter & operator=(const PedestrianRouter &s)
Invalidated assignment operator.
static double getTravelTimeStaticRandomized(const IntermodalEdge *const edge, const IntermodalTrip< E, N, V > *const trip, double time)
double getEffort(const E *const e, const V *const v, double t) const
IntermodalNetwork< E, L, N, V > _IntermodalNetwork
the base edge type that is given to the internal router (SUMOAbstractRouter)
Computes the shortest path through a network using the Dijkstra algorithm.
double gWeightsRandomFactor
virtual ~PedestrianRouter()
Destructor.
static double getTravelTimeStatic(const IntermodalEdge *const edge, const IntermodalTrip< E, N, V > *const trip, double time)
bool compute(const E *, const E *, const _IntermodalTrip *const, SUMOTime, std::vector< const E * > &, bool)
Builds the route between the given edges using the minimum effort at the given time The definition of...
virtual SUMOAbstractRouter< E, _IntermodalTrip > * clone()
_IntermodalNetwork * myPedNet
bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
Builds the route between the given edges using the minimum effort at the given time The definition of...
void prohibit(const std::vector< E * > &toProhibit)
_IntermodalEdge * getDepartConnector(const E *e, const int splitIndex=0) const
Returns the departing intermodal connector at the given split offset.
const std::vector< _IntermodalEdge * > & getAllEdges()
IntermodalEdge< E, L, N, V > _IntermodalEdge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void prohibit(const std::vector< E * > &toProhibit)
DijkstraRouter< _IntermodalEdge, _IntermodalTrip > _InternalRouter
the intermodal network storing edges, connections and the mappings to the "real" edges
const EdgePair & getBothDirections(const E *e) const
Returns the pair of forward and backward edge.
PedestrianRouter(_IntermodalNetwork *net)
_IntermodalEdge * getArrivalConnector(const E *e, const int splitIndex=0) const
Returns the arriving intermodal connector at the given split offset.
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)
IntermodalTrip< E, N, V > _IntermodalTrip
_InternalRouter * myInternalRouter