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-2018 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 /****************************************************************************/
15 // The AccessEdge is a special intermodal edge connecting different modes
16 /****************************************************************************/
17 #ifndef AccessEdge_h
18 #define AccessEdge_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "IntermodalEdge.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
33 template<class E, class L, class N, class V>
34 class AccessEdge : public IntermodalEdge<E, L, N, V> {
35 private:
37 
38 public:
39  AccessEdge(int numericalID, const _IntermodalEdge* inEdge, const _IntermodalEdge* outEdge, const double length) :
40  _IntermodalEdge(inEdge->getID() + ":" + outEdge->getID(), numericalID, outEdge->getEdge(), "!access"),
41  myLength(length > 0. ? length : NUMERICAL_EPS) { }
42 
43  double getTravelTime(const IntermodalTrip<E, N, V>* const trip, double /* time */) const {
44  return myLength / trip->speed;
45  }
46 
47 private:
48  const double myLength;
49 
50 };
51 
52 
53 #endif
54 
55 /****************************************************************************/
double getTravelTime(const IntermodalTrip< E, N, V > *const trip, double) const
Definition: AccessEdge.h:43
IntermodalEdge< E, L, N, V > _IntermodalEdge
Definition: AccessEdge.h:36
AccessEdge(int numericalID, const _IntermodalEdge *inEdge, const _IntermodalEdge *outEdge, const double length)
Definition: AccessEdge.h:39
const std::string & getID() const
Returns the id.
Definition: Named.h:78
const E * getEdge() const
const double myLength
Definition: AccessEdge.h:48
const double speed
the base edge type that is given to the internal router (SUMOAbstractRouter)
#define NUMERICAL_EPS
Definition: config.h:148
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)
the access edge connecting different modes that is given to the internal router (SUMOAbstractRouter) ...
Definition: AccessEdge.h:34