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.org/sumo
3// Copyright (C) 2001-2022 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 getStageSummary(const bool isPerson) const;
78
80 const std::string setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now, const bool vehicleArrived);
81
83 void setOrigin(const MSEdge* origin) {
84 myOrigin = origin;
85 }
86
88 void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
89
95 void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const {
97 UNUSED_PARAMETER(transportable);
98 }
99
105 void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
106
107private:
110
113
116
119
121 const std::string myVTypes;
122
124 const double mySpeed;
125
127 const double myWalkFactor;
128
131
133 const double myDepartPosLat;
134
137
138private:
141
144
145};
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:136
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 getStageSummary(const bool isPerson) const
return string summary of the current stage
const std::string myVTypes
The possible vehicles to use.
Definition: MSStageTrip.h:121
double myDepartPos
The depart position.
Definition: MSStageTrip.h:130
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:109
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Definition: MSStageTrip.h:95
const double mySpeed
The walking speed.
Definition: MSStageTrip.h:124
MSStoppingPlace * myOriginStop
the origin edge
Definition: MSStageTrip.h:112
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:115
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSStageTrip.h:127
const double myDepartPosLat
The lateral depart position.
Definition: MSStageTrip.h:133
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition: MSStageTrip.h:83
const SVCPermissions myModeSet
The allowed modes of transportation.
Definition: MSStageTrip.h:118
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