SUMO - Simulation of Urban MObility
MSCModel_NonInteracting.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2014-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The container following model for tranship (prototype)
17 /****************************************************************************/
18 #ifndef MSCModel_NonInteracting_h
19 #define MSCModel_NonInteracting_h
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <limits>
28 #include <utils/common/SUMOTime.h>
29 #include <utils/common/Command.h>
30 #include <microsim/MSContainer.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSNet;
37 class MSLink;
38 class MSLane;
39 class MSJunction;
40 class CState;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
52 public:
53 
56 
58 
60 
62  static void cleanup();
63 
66 
67 private:
69 
70 private:
71  class MoveToNextEdge : public Command {
72  public:
75  SUMOTime execute(SUMOTime currentTime);
76 
77  private:
80  private:
83  };
84 
85 
86 private:
89 
90 };
91 
92 class CState {
93 public:
94  CState() {};
95 
96  ~CState() {};
97 
98  // @brief walking directions
99  static const int FORWARD;
100  static const int BACKWARD;
101  static const int UNDEFINED_DIRECTION;
102 
104  static const double LATERAL_OFFSET;
105 
107  double getEdgePos(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
109  Position getPosition(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
111  double getAngle(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
113  double getSpeed(const MSContainer::MSContainerStage_Tranship& stage) const;
115  SUMOTime computeTranshipTime(const MSEdge* prev, const MSContainer::MSContainerStage_Tranship& stage, SUMOTime currentTime);
116 
117 
118 private:
123  Position myCurrentBeginPosition; //the position the container is moving from during its tranship stage
124  Position myCurrentEndPosition; //the position the container is moving to during its tranship stage
125 
126 };
127 
128 
129 #endif /* MSCModel_NonInteracting_h */
130 
Position myCurrentBeginPosition
SUMOTime myCurrentDuration
long long int SUMOTime
Definition: SUMOTime.h:36
MSCModel_NonInteracting(MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
static MSCModel_NonInteracting * myModel
The base class for an intersection.
Definition: MSJunction.h:61
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
double myCurrentBeginPos
MoveToNextEdge(MSTransportable *container, MSContainer::MSContainerStage_Tranship &tranship)
Base (microsim) event class.
Definition: Command.h:54
The simulated network and simulation perfomer.
Definition: MSNet.h:84
CState * add(MSTransportable *container, MSContainer::MSContainerStage_Tranship *stage, SUMOTime now)
register the given container as a transhiped container
A road/street connecting two junctions.
Definition: MSEdge.h:75
static const int BACKWARD
Position myCurrentEndPosition
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
MSNet * myNet
the net to which to issue moveToNextEdge commands
MSContainer::MSContainerStage_Tranship & myParent
static const double LATERAL_OFFSET
the offset for computing container positions when being transhiped
SUMOTime myLastEntryTime
SUMOTime execute(SUMOTime currentTime)
Executes the command.
The container following model for tranship.
Representation of a lane in the micro simulation.
Definition: MSLane.h:78
static const int UNDEFINED_DIRECTION
static MSCModel_NonInteracting * getModel()
static void cleanup()
remove state at simulation end