 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
16 #ifndef PublicTransportEdge_h
17 #define PublicTransportEdge_h
32 template<
class E,
class L,
class N,
class V>
41 std::vector<std::string>
ids;
79 if (begin > s.
begin) {
94 mySchedules.insert(std::make_pair(begin,
Schedule(
id, begin,
MAX2(repetitionNumber, 1), MAX2<SUMOTime>(period, 1), travelTime)));
101 for (
typename std::multimap<SUMOTime, Schedule>::const_iterator it =
mySchedules.begin(); it !=
mySchedules.end(); ++it) {
103 if (it->first > minArrival) {
107 int running = (int)(offset / s.
period);
108 if (offset % s.
period != 0) {
123 double getIntended(
const double time, std::string& intended)
const {
126 double bestDepartTime = std::numeric_limits<double>::max();
128 for (
typename std::multimap<SUMOTime, Schedule>::const_iterator it =
mySchedules.begin(); it !=
mySchedules.end(); ++it) {
130 if (it->first > minArrival) {
134 int running = (int)(offset / s.
period);
135 if (offset % s.
period != 0) {
144 if (s.
ids.size() == 1 || running >= (
int)s.
ids.size()) {
147 intended = s.
ids[running];
152 return bestDepartTime;
void addSchedule(const std::string id, const SUMOTime begin, const int repetitionNumber, const SUMOTime period, const SUMOTime travelTime)
Schedule & operator=(const Schedule &src)
Invalidated assignment operator.
const SUMOTime travelTime
std::vector< std::string > ids
Schedule(const std::string &_id, const SUMOTime _begin, const int _repetitionNumber, const SUMOTime _period, const SUMOTime _travelTime)
the public transport edge type connecting the stop edges
the base edge type that is given to the internal router (SUMOAbstractRouter)
bool includeInRoute(bool) const
double getIntended(const double time, std::string &intended) const
get intended vehicle id and departure time of next public transport ride
bool prohibits(const IntermodalTrip< E, N, V > *const trip) const
PublicTransportEdge(const std::string id, int numericalID, const IntermodalEdge< E, L, N, V > *entryStop, const E *endEdge, const std::string &line, const double length)
double getTravelTime(const IntermodalTrip< E, N, V > *const, double time) const
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const IntermodalEdge< E, L, N, V > * getEntryStop() const
bool hasSchedule(const SUMOTime begin) const
@ SVC_BUS
vehicle is a bus
std::multimap< SUMOTime, Schedule > mySchedules
const IntermodalEdge< E, L, N, V > *const myEntryStop
const std::string & getID() const
Returns the id.
const SVCPermissions modeSet
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)