Eclipse SUMO - Simulation of Urban MObility
MSStageWaiting.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 stage for planned waiting (stopping)
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class MSEdge;
30 class MSLane;
31 class MSNet;
32 class MSStoppingPlace;
33 class MSVehicleType;
34 class OutputDevice;
35 class MSTransportable;
36 
37 
41 class MSStageWaiting : public MSStage {
42 public:
44  MSStageWaiting(const MSEdge* destination, MSStoppingPlace* toStop, SUMOTime duration, SUMOTime until,
45  double pos, const std::string& actType, const bool initial);
46 
48  virtual ~MSStageWaiting();
49 
50  MSStage* clone() const;
51 
53  void abort(MSTransportable*);
54 
55  SUMOTime getUntil() const;
56 
58 
60  // not a travelling stage
61  return 0;
62  }
63 
64  SUMOTime getDuration() const;
65 
66  SUMOTime getStopEnd() const {
67  return myStopEndTime;
68  }
70  Position getPosition(SUMOTime now) const;
71 
72  double getAngle(SUMOTime now) const;
73 
75  double getDistance() const {
76  return 0;
77  }
78 
79  std::string getStageDescription(const bool isPerson) const;
80 
81  std::string getStageSummary(const bool isPerson) const;
82 
84  void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
85 
91  void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
92 
100  void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
101 
102  void saveState(std::ostringstream& out);
103 
104  void loadState(MSTransportable* transportable, std::istringstream& state);
105 
106 private:
109 
112 
115 
117  std::string myActType;
118 
121 
122 private:
125 
128 
129 };
long long int SUMOTime
Definition: GUI.h:35
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
MSStageWaiting(const MSStageWaiting &)
Invalidated copy constructor.
void loadState(MSTransportable *transportable, std::istringstream &state)
Reconstructs the current state, standard implementation does nothing.
void routeOutput(const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const
Called on writing vehroute output.
MSStageWaiting & operator=(const MSStageWaiting &)=delete
Invalidated assignment operator.
SUMOTime getUntil() const
double getDistance() const
get travel distance in this stage
SUMOTime myWaitingDuration
the time the person is waiting
SUMOTime myWaitingUntil
the time until the person is waiting
SUMOTime getDuration() const
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
void saveState(std::ostringstream &out)
Saves the current state into the given stream, standard implementation does nothing.
std::string getStageDescription(const bool isPerson) const
return (brief) string representation of the current stage
double getAngle(SUMOTime now) const
returns the angle of the transportable
SUMOTime getPlannedDuration() const
Position myStopWaitPos
waiting position at stopping place
SUMOTime getTravelTime() const
SUMOTime myStopEndTime
stores the actual end time of the stop (combination of duration and until)
MSStage * clone() const
std::string myActType
The type of activity.
virtual ~MSStageWaiting()
destructor
void abort(MSTransportable *)
abort this stage (TraCI)
std::string getStageSummary(const bool isPerson) const
return string summary of the current stage
Position getPosition(SUMOTime now) const
returns the position of the transportable
MSStageWaiting(const MSEdge *destination, MSStoppingPlace *toStop, SUMOTime duration, SUMOTime until, double pos, const std::string &actType, const bool initial)
constructor
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
SUMOTime getStopEnd() const
A lane area vehicles can halt at.
The car-following model and parameter.
Definition: MSVehicleType.h:63
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