Eclipse SUMO - Simulation of Urban MObility
MSStageTrip.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // An intermodal routing request (to be transformed into a sequence of walks and rides)
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
25 
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 class MSTransportable;
31 class MSEdge;
32 class MSLane;
33 class MSNet;
34 class MSStoppingPlace;
35 class OutputDevice;
36 
40 class MSStageTrip : public MSStage {
41 public:
43  MSStageTrip(const MSEdge* origin, MSStoppingPlace* fromStop,
44  const MSEdge* destination, MSStoppingPlace* toStop,
45  const SUMOTime duration, const SVCPermissions modeSet,
46  const std::string& vTypes, const double speed, const double walkFactor,
47  const std::string& group,
48  const double departPosLat, const bool hasArrivalPos, const double arrivalPos);
49 
51  virtual ~MSStageTrip();
52 
53  MSStage* clone() const;
54 
55  const MSEdge* getEdge() const;
56 
58  return myOriginStop;
59  }
60 
61  double getEdgePos(SUMOTime now) const;
62 
63  Position getPosition(SUMOTime now) const;
64 
65  double getAngle(SUMOTime now) const;
66 
67  double getDistance() const {
68  // invalid
69  return -1;
70  }
71 
72  std::string getStageDescription(const bool isPerson) const {
73  UNUSED_PARAMETER(isPerson);
74  return "trip";
75  }
76 
77  std::string getOriginDescription() const;
78  std::string getDestinationDescription() const;
79 
80  std::string getStageSummary(const bool isPerson) const;
81 
83  const std::string setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now, const bool vehicleArrived);
84 
86  void setOrigin(const MSEdge* origin) {
87  myOrigin = origin;
88  }
89 
91  void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
92 
98  void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const {
99  UNUSED_PARAMETER(os);
100  UNUSED_PARAMETER(transportable);
101  }
102 
105  return 0;
106  }
107 
109  return 0;
110  }
111 
117  void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
118 
120  bool isWalk() const {
121  return myModeSet == 0;
122  }
123 
124 private:
126  const MSEdge* myOrigin;
127 
130 
133 
136 
138  const std::string myVTypes;
139 
141  const double mySpeed;
142 
144  const double myWalkFactor;
145 
147  double myDepartPos;
148 
150  const double myDepartPosLat;
151 
153  const bool myHaveArrivalPos;
154 
155 private:
158 
161 
162 };
long long int SUMOTime
Definition: GUI.h:35
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
A road/street connecting two junctions.
Definition: MSEdge.h:77
Representation of a lane in the micro simulation.
Definition: MSLane.h:84
The simulated network and simulation perfomer.
Definition: MSNet.h:89
MSStageTrip(const MSStageTrip &)
Invalidated copy constructor.
const bool myHaveArrivalPos
whether an arrivalPos was in the input
Definition: MSStageTrip.h:153
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSStageTrip.cpp:91
MSStageTrip(const MSEdge *origin, MSStoppingPlace *fromStop, const MSEdge *destination, MSStoppingPlace *toStop, const SUMOTime duration, const SVCPermissions modeSet, const std::string &vTypes, const double speed, const double walkFactor, const std::string &group, const double departPosLat, const bool hasArrivalPos, const double arrivalPos)
constructor
Definition: MSStageTrip.cpp:51
MSStageTrip & operator=(const MSStageTrip &)
Invalidated assignment operator.
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
bool isWalk() const
Whether the transportable is walking.
Definition: MSStageTrip.h:120
const std::string setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now, const bool vehicleArrived)
logs end of the step
double getDistance() const
get travel distance in this stage
Definition: MSStageTrip.h:67
std::string getStageDescription(const bool isPerson) const
return (brief) string representation of the current stage
Definition: MSStageTrip.h:72
std::string getOriginDescription() const
std::string getStageSummary(const bool isPerson) const
return string summary of the current stage
const std::string myVTypes
The possible vehicles to use.
Definition: MSStageTrip.h:138
double myDepartPos
The depart position.
Definition: MSStageTrip.h:147
double getEdgePos(SUMOTime now) const
MSStage * clone() const
Definition: MSStageTrip.cpp:73
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSStageTrip.cpp:98
void routeOutput(const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const
Called on writing vehroute output.
const MSEdge * myOrigin
the origin edge
Definition: MSStageTrip.h:126
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Definition: MSStageTrip.h:98
const double mySpeed
The walking speed.
Definition: MSStageTrip.h:141
MSStoppingPlace * myOriginStop
the origin edge
Definition: MSStageTrip.h:129
std::string getDestinationDescription() const
SUMOTime myDuration
the time the trip should take (applies to only walking)
Definition: MSStageTrip.h:132
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSStageTrip.h:144
const double myDepartPosLat
The lateral depart position.
Definition: MSStageTrip.h:150
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition: MSStageTrip.h:86
MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for MSStageTrip
Definition: MSStageTrip.h:57
const SVCPermissions myModeSet
The allowed modes of transportation.
Definition: MSStageTrip.h:135
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSStageTrip.cpp:84
virtual ~MSStageTrip()
destructor
Definition: MSStageTrip.cpp:70
SUMOTime getTravelTime() const
Definition: MSStageTrip.h:108
SUMOTime getDuration() const
trip doesn't participate in plan summary
Definition: MSStageTrip.h:104
A lane area vehicles can halt at.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37