Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-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 stage for planned waiting (stopping)
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
25
26// ===========================================================================
27// class declarations
28// ===========================================================================
29class MSEdge;
30class MSLane;
31class MSNet;
32class MSStoppingPlace;
33class MSVehicleType;
34class OutputDevice;
35class MSTransportable;
36
37
41class MSStageWaiting : public MSStage {
42public:
44 MSStageWaiting(const MSEdge* destination, MSStoppingPlace* toStop, SUMOTime duration, SUMOTime until,
45 double pos, const std::string& actType, const bool initial, SUMOTime jumpDuration = -1);
46
48 virtual ~MSStageWaiting();
49
50 MSStage* clone() const;
51
54
55 SUMOTime getUntil() const;
56
58
60 return myJumpDuration;
61 }
62
64 // not a travelling stage
65 return 0;
66 }
67
68 SUMOTime getDuration() const;
69
71 return myStopEndTime;
72 }
73
74 Position getPosition(SUMOTime now) const;
75
76 double getAngle(SUMOTime now) const;
77
79 double getDistance() const {
80 return 0;
81 }
82
83 std::string getStageDescription(const bool isPerson) const;
84
85 std::string getStageSummary(const bool isPerson) const;
86
88 void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
89
95 void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
96
104 void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
105
106 void saveState(std::ostringstream& out);
107
108 void loadState(MSTransportable* transportable, std::istringstream& state);
109
110private:
113
116
119
121 std::string myActType;
122
125
128
129private:
132
135
136};
long long int SUMOTime
Definition GUI.h:36
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
MSStage(const MSStageType type, const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, const double arrivalPosLat=0.0, const std::string &group="")
constructor
Definition MSStage.cpp:47
MSStageWaiting(const MSStageWaiting &)
Invalidated copy constructor.
MSStageWaiting & operator=(const MSStageWaiting &)=delete
Invalidated assignment operator.
SUMOTime getJumpDuration() const
Return the current jump duration (if applicable).
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.
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
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
SUMOTime myJumpDuration
the jump duration if this stop is followed by a jump
MSStageWaiting(const MSEdge *destination, MSStoppingPlace *toStop, SUMOTime duration, SUMOTime until, double pos, const std::string &actType, const bool initial, SUMOTime jumpDuration=-1)
constructor
SUMOTime getStopEnd() const
A lane area vehicles can halt at.
The car-following model and parameter.
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