19 #ifndef PedestrianRouter_h 20 #define PedestrianRouter_h 53 template<
class E,
class L,
class N,
class V,
class INTERNALROUTER>
88 double compute(
const E* from,
const E* to,
double departPos,
double arrivalPos,
double speed,
89 SUMOTime msTime,
const N* onlyNode, std::vector<const E*>& into,
bool allEdges =
false) {
90 if (getSidewalk<E, L>(from) == 0) {
91 WRITE_WARNING(
"Departure edge '" + from->getID() +
"' does not allow pedestrians.");
94 if (getSidewalk<E, L>(to) == 0) {
95 WRITE_WARNING(
"Destination edge '" + to->getID() +
"' does not allow pedestrians.");
98 _IntermodalTrip trip(from, to, departPos, arrivalPos, speed, msTime, onlyNode);
99 std::vector<const _IntermodalEdge*> intoPed;
102 &trip, msTime, intoPed);
105 for (
const _IntermodalEdge* pedEdge : intoPed) {
106 if (pedEdge->includeInRoute(allEdges)) {
107 into.push_back(pedEdge->getEdge());
112 #ifdef PedestrianRouter_DEBUG_ROUTES 113 std::cout <<
TIME2STEPS(msTime) <<
" trip from " << from->getID() <<
" to " << to->getID()
114 <<
" departPos=" << departPos
115 <<
" arrivalPos=" << arrivalPos
116 <<
" onlyNode=" << (onlyNode == 0 ?
"NULL" : onlyNode->getID())
118 <<
" resultEdges=" <<
toString(into)
122 return success ? time : -1.;
127 bool compute(
const E*,
const E*,
const _IntermodalTrip*
const,
137 std::vector<_IntermodalEdge*> toProhibitPE;
138 for (
typename std::vector<E*>::const_iterator it = toProhibit.begin(); it != toProhibit.end(); ++it) {
158 template<
class E,
class L,
class N,
class V>
160 DijkstraRouter<IntermodalEdge<E, L, N, V>, IntermodalTrip<E, N, V>, prohibited_withPermissions<IntermodalEdge<E, L, N, V>, IntermodalTrip<E, N, V> > > > { };
const EdgePair & getBothDirections(const E *e) const
Returns the pair of forward and backward edge.
_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()
INTERNALROUTER * myInternalRouter
IntermodalNetwork< E, L, N, V > _IntermodalNetwork
PedestrianRouter()
Constructor.
static double getTravelTimeStatic(const IntermodalEdge *const edge, const IntermodalTrip< E, N, V > *const trip, double time)
PedestrianRouter(_IntermodalNetwork *net)
virtual SUMOAbstractRouter< E, _IntermodalTrip > * clone()
IntermodalEdge< E, L, N, V > _IntermodalEdge
PedestrianRouter & operator=(const PedestrianRouter &s)
Invalidated assignment operator.
#define WRITE_WARNING(msg)
bool compute(const E *, const E *, const _IntermodalTrip *const, SUMOTime, std::vector< const E *> &)
Builds the route between the given edges using the minimum effort at the given time The definition of...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void prohibit(const std::vector< E *> &toProhibit)
double recomputeCosts(const std::vector< const E *> &, const _IntermodalTrip *const, SUMOTime) const
_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)
the intermodal network storing edges, connections and the mappings to the "real" edges ...
the base edge type that is given to the internal router (SUMOAbstractRouter)
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...
_IntermodalNetwork * myPedNet
virtual ~PedestrianRouter()
Destructor.
IntermodalTrip< E, N, V > _IntermodalTrip