Eclipse SUMO - Simulation of Urban MObility
MSStageTranship.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 // The class for modelling container-movements
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <string>
25 #include <vector>
26 #include <set>
27 #include <utils/common/SUMOTime.h>
28 #include <utils/common/Command.h>
29 #include <utils/geom/Position.h>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSNet;
38 class MSEdge;
39 class MSLane;
40 class OutputDevice;
42 class MSStoppingPlace;
43 class SUMOVehicle;
44 class MSVehicleType;
45 class MSCModel_NonInteracting;
46 class CState;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
58 
59 public:
61  MSStageTranship(const std::vector<const MSEdge*>& route, MSStoppingPlace* toStop, double speed, double departPos, double arrivalPos);
62 
65 
66  MSStage* clone() const;
67 
69  void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous);
70 
72  double getDistance() const;
73 
75  std::string getStageDescription(const bool isPerson) const {
76  UNUSED_PARAMETER(isPerson);
77  return "tranship";
78  }
79  std::string getStageSummary(const bool isPerson) const;
80 
85  void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
86 
94  void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const;
95 
97  bool moveToNextEdge(MSTransportable* container, SUMOTime currentTime, int prevDir, MSEdge* nextInternal = 0);
98 
99 
101  inline double getMaxSpeed(const MSTransportable* const transportable = nullptr) const {
102  UNUSED_PARAMETER(transportable);
103  return mySpeed;
104  }
105 
106  inline double getArrivalPos() const {
107  return myArrivalPos;
108  }
109 
110  inline const MSEdge* getNextRouteEdge() const {
111  return myRouteStep == myRoute.end() - 1 ? 0 : *(myRouteStep + 1);
112  }
113 
114 private:
117 
120 
121 };
long long int SUMOTime
Definition: GUI.h:35
#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:89
double myArrivalPos
the longitudinal position at which we want to arrive
Definition: MSStage.h:275
double mySpeed
the speed of the transportable
std::vector< const MSEdge * > myRoute
The route of the container.
std::vector< const MSEdge * >::iterator myRouteStep
current step
MSStage * clone() const
double getArrivalPos() const
void routeOutput(const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const
Called on writing vehroute output.
double getDistance() const
get travel distance in this stage
bool moveToNextEdge(MSTransportable *container, SUMOTime currentTime, int prevDir, MSEdge *nextInternal=0)
move forward and return whether the container arrived
MSStageTranship(const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, double speed, double departPos, double arrivalPos)
constructor
double getMaxSpeed(const MSTransportable *const transportable=nullptr) const
the maximum speed of the transportable
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
MSStageTranship(const MSStageTranship &)
Invalidated copy constructor.
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
std::string getStageDescription(const bool isPerson) const
Returns the current stage description as a string.
~MSStageTranship()
destructor
std::string getStageSummary(const bool isPerson) const
return string summary of the current stage
MSStageTranship & operator=(const MSStageTranship &)
Invalidated assignment operator.
const MSEdge * getNextRouteEdge() 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
Representation of a vehicle.
Definition: SUMOVehicle.h:60
Structure representing possible vehicle parameter.