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-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
double getAngle(SUMOTime now) const
returns the angle of the transportable
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.
double myDepartPos
The depart position.
double getEdgePos(SUMOTime now) const
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.
Definition MSStageTrip.h:98
const double mySpeed
The walking speed.
MSStoppingPlace * myOriginStop
the origin edge
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.
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition MSStageTrip.h:86
const SVCPermissions myModeSet
The allowed modes of transportation.
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual ~MSStageTrip()
destructor
A lane area vehicles can halt at.
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