22 #ifndef IntermodalEdge_h 23 #define IntermodalEdge_h 43 #define TL_RED_PENALTY 20 48 template <
class E,
class L>
53 const std::vector<L*>& lanes = edge->getLanes();
54 for (
typename std::vector<L*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
68 template<
class E,
class N,
class V>
76 departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos),
77 arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos),
111 template<
class E,
class L,
class N,
class V>
114 IntermodalEdge(
const std::string
id,
unsigned int numericalID,
const E* edge,
const std::string& line) :
116 myNumericalID(numericalID),
119 myLength(edge->getLength()) { }
136 return myNumericalID;
140 myFollowingEdges.push_back(s);
144 myFollowingEdges = edges;
148 myFollowingEdges.clear();
152 myFollowingEdges.erase(std::find(myFollowingEdges.begin(), myFollowingEdges.end(), edge));
157 return myFollowingEdges;
208 template<
class E,
class L,
class N,
class V>
212 IntermodalEdge<E, L, N, V>(edge->
getID() + (edge->isWalkingArea() ?
"" : (forward ?
"_fwd" :
"_bwd")) +
toString(pos), numericalID, edge,
"!ped"),
215 myStartPos(pos >= 0 ? pos : 0.) { }
218 return allEdges || (!this->getEdge()->isCrossing() && !this->getEdge()->isWalkingArea());
222 if (trip->
node == 0) {
227 return (this->getEdge()->getFromJunction() != trip->
node 228 && this->getEdge()->getToJunction() != trip->
node);
233 SUMOReal length = this->getLength();
234 if (this->getEdge() == trip->
from && !myForward) {
237 if (this->getEdge() == trip->
to && myForward) {
240 if (this->getEdge() == trip->
from && myForward) {
241 length -= (trip->
departPos - myStartPos);
243 if (this->getEdge() == trip->
to && !myForward) {
250 if (this->getEdge()->isCrossing() && myLane->getIncomingLinkState() ==
LINKSTATE_TL_RED) {
254 #ifdef IntermodalRouter_DEBUG_EFFORTS 255 std::cout <<
" effort for " << trip->
getID() <<
" at " << time <<
" edge=" << edge->getID() <<
" effort=" << length / trip->
speed + tlsDelay <<
" l=" << length <<
" s=" << trip->
speed <<
" tlsDelay=" << tlsDelay <<
"\n";
257 return length / trip->
speed + tlsDelay;
SUMOReal myLength
adaptable length (for splitted edges)
SUMOReal getLength() const
virtual bool prohibits(const IntermodalTrip< E, N, V > *const ) const
const E *const myEdge
the original edge
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
const std::string myLine
public transport line or ped vs car
void addSuccessor(IntermodalEdge *s)
std::string time2string(SUMOTime t)
bool includeInRoute(bool allEdges) const
std::vector< IntermodalEdge * > myFollowingEdges
List of edges that may be approached from this edge.
IntermodalEdge(const std::string id, unsigned int numericalID, const E *edge, const std::string &line)
PedestrianEdge(unsigned int numericalID, const E *edge, const L *lane, bool forward, const SUMOReal pos=-1.)
const std::string & getLine() const
void removeSuccessor(const IntermodalEdge *const edge)
virtual SUMOReal getTravelTime(const IntermodalTrip< E, N, V > *const , SUMOReal) const
std::string getID() const
unsigned int getNumericalID() const
const SVCPermissions modeSet
const bool myForward
the direction of this edge
const SUMOTime departTime
IntermodalTrip & operator=(const IntermodalTrip &)
Invalidated assignment operator.
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)
const L * myLane
the original edge
virtual ~IntermodalEdge()
IntermodalTrip(const E *_from, const E *_to, SUMOReal _departPos, SUMOReal _arrivalPos, SUMOReal _speed, SUMOTime _departTime, const N *_node, const V *_vehicle=0, const SVCPermissions _modeSet=SVC_PEDESTRIAN)
virtual bool includeInRoute(bool) const
const unsigned int myNumericalID
the index in myEdges
const E * getEdge() const
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
virtual const std::vector< IntermodalEdge * > & getSuccessors(SUMOVehicleClass) const
Base class for objects which have an id.
the base edge type that is given to the internal router (SUMOAbstractRouter)
const SUMOReal arrivalPos
The link has red light (must brake)
const SUMOReal myStartPos
the starting position for split edges
static SUMOReal getTravelTimeStatic(const IntermodalEdge *const edge, const IntermodalTrip< E, N, V > *const trip, SUMOReal time)
void setLength(const SUMOReal length)
the pedestrian edge type that is given to the internal router (SUMOAbstractRouter) ...
SUMOVehicleClass getVClass() const
void setSuccessors(const std::vector< IntermodalEdge * > &edges)
virtual SUMOReal getTravelTime(const IntermodalTrip< E, N, V > *const trip, SUMOReal time) const
const L * getSidewalk(const E *edge)
bool prohibits(const IntermodalTrip< E, N, V > *const trip) const