Eclipse SUMO - Simulation of Urban MObility
AccessEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // The AccessEdge is a special intermodal edge connecting different modes
15 /****************************************************************************/
16 #ifndef AccessEdge_h
17 #define AccessEdge_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include "IntermodalEdge.h"
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
32 template<class E, class L, class N, class V>
33 class AccessEdge : public IntermodalEdge<E, L, N, V> {
34 private:
36 
37 public:
38  AccessEdge(int numericalID, const _IntermodalEdge* inEdge, const _IntermodalEdge* outEdge, const double length) :
39  _IntermodalEdge(inEdge->getID() + ":" + outEdge->getID(), numericalID, outEdge->getEdge(), "!access"),
40  myLength(length > 0. ? length : NUMERICAL_EPS) { }
41 
42  double getTravelTime(const IntermodalTrip<E, N, V>* const trip, double /* time */) const {
43  return myLength / trip->speed;
44  }
45 
46 private:
47  const double myLength;
48 
49 };
50 
51 
52 #endif
53 
54 /****************************************************************************/
IntermodalEdge.h
IntermodalTrip::speed
const double speed
Definition: IntermodalTrip.h:81
NUMERICAL_EPS
#define NUMERICAL_EPS
Definition: config.h:148
IntermodalEdge
the base edge type that is given to the internal router (SUMOAbstractRouter)
Definition: IntermodalEdge.h:39
AccessEdge
the access edge connecting different modes that is given to the internal router (SUMOAbstractRouter)
Definition: AccessEdge.h:33
AccessEdge::getTravelTime
double getTravelTime(const IntermodalTrip< E, N, V > *const trip, double) const
Definition: AccessEdge.h:42
AccessEdge::_IntermodalEdge
IntermodalEdge< E, L, N, V > _IntermodalEdge
Definition: AccessEdge.h:35
IntermodalEdge::getEdge
const E * getEdge() const
Definition: IntermodalEdge.h:59
AccessEdge::AccessEdge
AccessEdge(int numericalID, const _IntermodalEdge *inEdge, const _IntermodalEdge *outEdge, const double length)
Definition: AccessEdge.h:38
AccessEdge::myLength
const double myLength
Definition: AccessEdge.h:47
config.h
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
IntermodalTrip
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)
Definition: IntermodalTrip.h:38