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-2023 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
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 {
100 UNUSED_PARAMETER(transportable);
101 }
102
108 void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
109
110private:
113
116
119
122
124 const std::string myVTypes;
125
127 const double mySpeed;
128
130 const double myWalkFactor;
131
134
136 const double myDepartPosLat;
137
140
141private:
144
147
148};
long long int SUMOTime
Definition: GUI.h:36
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:88
MSStageTrip(const MSStageTrip &)
Invalidated copy constructor.
const bool myHaveArrivalPos
whether an arrivalPos was in the input
Definition: MSStageTrip.h:139
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSStageTrip.cpp:87
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:50
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
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:124
double myDepartPos
The depart position.
Definition: MSStageTrip.h:133
double getEdgePos(SUMOTime now) const
MSStage * clone() const
Definition: MSStageTrip.cpp:72
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSStageTrip.cpp:94
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
Definition: MSStageTrip.h:112
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:127
MSStoppingPlace * myOriginStop
the origin edge
Definition: MSStageTrip.h:115
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)
Definition: MSStageTrip.h:118
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSStageTrip.h:130
const double myDepartPosLat
The lateral depart position.
Definition: MSStageTrip.h:136
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition: MSStageTrip.h:86
const SVCPermissions myModeSet
The allowed modes of transportation.
Definition: MSStageTrip.h:121
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSStageTrip.cpp:80
virtual ~MSStageTrip()
destructor
Definition: MSStageTrip.cpp:69
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