SUMO - Simulation of Urban MObility
IntermodalTrip.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 /****************************************************************************/
17 // The "vehicle" definition for the Intermodal Router
18 /****************************************************************************/
19 #ifndef IntermodalTrip_h
20 #define IntermodalTrip_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <vector>
30 
31 #include "EffortCalculator.h"
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
38 template<class E, class N, class V>
40 public:
41  IntermodalTrip(const E* _from, const E* _to, double _departPos, double _arrivalPos,
42  double _speed, SUMOTime _departTime, const N* _node,
43  const V* _vehicle = 0, const SVCPermissions _modeSet = SVC_PEDESTRIAN,
44  const EffortCalculator* const _calc = nullptr, const double _externalFactor = 0.) :
45  from(_from),
46  to(_to),
47  departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos),
48  arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos),
49  speed(_speed),
50  departTime(_departTime),
51  node(_node),
52  vehicle(_vehicle),
53  modeSet(_modeSet),
54  calc(_calc),
55  externalFactor(_externalFactor) {
56  }
57 
58  // exists just for debugging purposes
59  std::string getID() const {
60  return from->getID() + ":" + to->getID() + ":" + time2string(departTime);
61  }
62 
63 
64  inline SUMOVehicleClass getVClass() const {
65  return vehicle != 0 ? vehicle->getVClass() : SVC_PEDESTRIAN;
66  }
67 
68  const E* const from;
69  const E* const to;
70  const double departPos;
71  const double arrivalPos;
72  const double speed;
74  const N* const node; // indicates whether only routing across this node shall be performed
75  const V* const vehicle; // indicates which vehicle may be used
77  const EffortCalculator* const calc;
78  const double externalFactor;
79 
80 private:
83 };
84 
85 
86 #endif
87 
88 /****************************************************************************/
SUMOVehicleClass getVClass() const
long long int SUMOTime
Definition: SUMOTime.h:36
is a pedestrian
const V *const vehicle
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
std::string getID() const
const N *const node
const EffortCalculator *const calc
const E *const to
the effort calculator interface
IntermodalTrip(const E *_from, const E *_to, double _departPos, double _arrivalPos, double _speed, SUMOTime _departTime, const N *_node, const V *_vehicle=0, const SVCPermissions _modeSet=SVC_PEDESTRIAN, const EffortCalculator *const _calc=nullptr, const double _externalFactor=0.)
const double departPos
const double speed
const SUMOTime departTime
const double arrivalPos
const SVCPermissions modeSet
const double externalFactor
IntermodalTrip & operator=(const IntermodalTrip &)
Invalidated assignment operator.
the "vehicle" type that is given to the internal router (SUMOAbstractRouter)
const E *const from