Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-2025 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// ===========================================================================
30class MSTransportable;
31class MSEdge;
32class MSLane;
33class MSNet;
34class MSStoppingPlace;
35class OutputDevice;
36
40class MSStageTrip : public MSStage {
41public:
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
82 std::vector<SUMOVehicle*> getVehicles(MSVehicleControl& vehControl, MSTransportable* transportable, const MSEdge* origin);
83
84 const std::string reroute(const SUMOTime time, MSTransportableRouter& router, MSTransportable* const transportable,
85 MSStage* previous, const MSEdge* origin, const MSEdge* destination, std::vector<MSStage*>& stages);
86
88 const std::string setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now, const bool vehicleArrived);
89
91 void setOrigin(const MSEdge* origin, MSStoppingPlace* originStop, double departPos) {
92 myOrigin = origin;
93 myOriginStop = originStop;
94 myDepartPos = departPos;
95 }
96
98 void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
99
105 void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const {
107 UNUSED_PARAMETER(transportable);
108 }
109
112 return 0;
113 }
114
116 return 0;
117 }
118
124 void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
125
127 bool isWalk() const {
128 return myModeSet == 0;
129 }
130
131private:
134
137
140
143
145 const std::string myVTypes;
146
148 const double mySpeed;
149
151 const double myWalkFactor;
152
155
157 const double myDepartPosLat;
158
161
162private:
165
168
169};
long long int SUMOTime
Definition GUI.h:36
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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
double getAngle(SUMOTime now) const
returns the angle of the transportable
void setOrigin(const MSEdge *origin, MSStoppingPlace *originStop, double departPos)
change origin for parking area rerouting
Definition MSStageTrip.h:91
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
bool isWalk() const
Whether the transportable is walking.
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.
double myDepartPos
The depart position.
double getEdgePos(SUMOTime now) const
const std::string reroute(const SUMOTime time, MSTransportableRouter &router, MSTransportable *const transportable, MSStage *previous, const MSEdge *origin, const MSEdge *destination, std::vector< MSStage * > &stages)
MSStage * clone() const
const MSEdge * getEdge() const
Returns the current edge.
MSStageTrip & operator=(const MSStageTrip &)
Invalidated assignment operator.
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
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
const double mySpeed
The walking speed.
MSStoppingPlace * myOriginStop
the origin edge
std::vector< SUMOVehicle * > getVehicles(MSVehicleControl &vehControl, MSTransportable *transportable, const MSEdge *origin)
std::string getDestinationDescription() const
MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for MSStageTrip
Definition MSStageTrip.h:57
SUMOTime myDuration
the time the trip should take (applies to only walking)
const double myWalkFactor
The factor to apply to walking durations.
const double myDepartPosLat
The lateral depart position.
const SVCPermissions myModeSet
The allowed modes of transportation.
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual ~MSStageTrip()
destructor
SUMOTime getTravelTime() const
SUMOTime getDuration() const
trip doesn't participate in plan summary
A lane area vehicles can halt at.
The class responsible for building and deletion of vehicles.
Static storage of an output device and its base (abstract) implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
#define UNUSED_PARAMETER(x)