Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSStop.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2005-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// A lane area vehicles can halt at
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
25#include "MSRoute.h"
26
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31class MSLane;
32class MESegment;
33class MSStoppingPlace;
34class MSParkingArea;
35class SUMOVehicle;
36
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
44class MSStop {
45public:
50 const MSLane* lane = nullptr;
52 const MESegment* segment = nullptr;
69 bool triggered = false;
71 bool containerTriggered = false;
73 bool joinTriggered = false;
75 bool reached = false;
87 bool isOpposite = false;
89 bool skipOnDemand = false;
91 bool startedFromState = false;
92
94 void write(OutputDevice& dev) const;
95
97 double getEndPos(const SUMOVehicle& veh) const;
98
100 double getReachedThreshold() const;
101
103 std::string getDescription() const;
104
106 void initPars(const SUMOVehicleParameter::Stop& stopPar);
107
108 const MSEdge* getEdge() const;
109
111 int getStateFlagsOld() const;
112
114 SUMOTime getMinDuration(SUMOTime time) const;
115
117 SUMOTime getUntil() const;
118
120 SUMOTime getArrival() const;
121
123 double getSpeed() const;
124
126 bool isInRange(const double pos, const double tolerance) const;
127};
long long int SUMOTime
Definition GUI.h:36
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition MSRoute.h:57
#define SUMOTime_MAX
Definition SUMOTime.h:34
A single mesoscopic segment (cell)
Definition MESegment.h:49
A road/street connecting two junctions.
Definition MSEdge.h:77
Representation of a lane in the micro simulation.
Definition MSLane.h:84
A lane area vehicles can halt at.
void write(OutputDevice &dev) const
Write the current stop configuration (used for state saving)
Definition MSStop.cpp:92
const MSLane * lane
The lane to stop at (microsim only)
Definition MSStop.h:50
bool triggered
whether an arriving person lets the vehicle continue
Definition MSStop.h:69
bool containerTriggered
whether an arriving container lets the vehicle continue
Definition MSStop.h:71
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
Definition MSStop.h:83
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
Definition MSStop.h:56
MSStop(const SUMOVehicleParameter::Stop &par)
Definition MSStop.h:46
double getSpeed() const
return speed for passing waypoint / skipping on-demand stop
Definition MSStop.cpp:163
bool joinTriggered
whether coupling another vehicle (train) the vehicle continue
Definition MSStop.h:73
bool isOpposite
whether this an opposite-direction stop
Definition MSStop.h:87
SUMOTime getMinDuration(SUMOTime time) const
return minimum stop duration when starting stop at time
Definition MSStop.cpp:134
void initPars(const SUMOVehicleParameter::Stop &stopPar)
initialize attributes from the given stop parameters
Definition MSStop.cpp:112
int getStateFlagsOld() const
return flags as used by Vehicle::getStopState
Definition MSStop.cpp:128
const MESegment * segment
The segment to stop at (mesosim only)
Definition MSStop.h:52
int numExpectedContainer
The number of still expected containers.
Definition MSStop.h:79
bool reached
Information whether the stop has been reached.
Definition MSStop.h:75
MSRouteIterator edge
The edge in the route to stop at.
Definition MSStop.h:48
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
Definition MSStop.h:81
bool skipOnDemand
whether the decision to skip this stop has been made
Definition MSStop.h:89
bool isInRange(const double pos, const double tolerance) const
whether the stop is in range of the given position
Definition MSStop.cpp:169
const MSEdge * getEdge() const
Definition MSStop.cpp:54
double getReachedThreshold() const
return startPos taking into account opposite stopping
Definition MSStop.cpp:64
SUMOTime endBoarding
the maximum time at which persons may board this vehicle
Definition MSStop.h:85
double getEndPos(const SUMOVehicle &veh) const
return halting position for upcoming stop;
Definition MSStop.cpp:35
int numExpectedPerson
The number of still expected persons.
Definition MSStop.h:77
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
Definition MSStop.h:58
bool startedFromState
whether the 'started' value was loaded from simulaton state
Definition MSStop.h:91
MSStoppingPlace * chargingStation
(Optional) charging station if one is assigned to the stop
Definition MSStop.h:60
std::string getDescription() const
get a short description for showing in the gui
Definition MSStop.cpp:69
SUMOTime duration
The stopping duration.
Definition MSStop.h:67
SUMOTime getUntil() const
return until / ended time
Definition MSStop.cpp:151
SUMOTime getArrival() const
return arrival / started time
Definition MSStop.cpp:157
const SUMOVehicleParameter::Stop pars
The stop parameter.
Definition MSStop.h:65
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Definition MSStop.h:54
MSStoppingPlace * overheadWireSegment
(Optional) overhead wire segment if one is assigned to the stop
Definition MSStop.h:63
A lane area vehicles can halt at.
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle.
Definition SUMOVehicle.h:62
Definition of vehicle stop (position and duration)