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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The container following model for tranship (prototype)
19 /****************************************************************************/
20 #ifndef MSCModel_NonInteracting_h
21 #define MSCModel_NonInteracting_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <limits>
34 #include <utils/common/SUMOTime.h>
35 #include <utils/common/Command.h>
36 #include <microsim/MSContainer.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSNet;
43 class MSLink;
44 class MSLane;
45 class MSJunction;
46 class CState;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
58 public:
59 
62 
64 
66 
68  static void cleanup();
69 
72 
73 private:
75 
76 private:
77  class MoveToNextEdge : public Command {
78  public:
81  SUMOTime execute(SUMOTime currentTime);
82 
83  private:
86  private:
89  };
90 
91 
92 private:
95 
96 };
97 
98 class CState {
99 public:
100  CState() {};
101 
102  ~CState() {};
103 
104  // @brief walking directions
105  static const int FORWARD;
106  static const int BACKWARD;
107  static const int UNDEFINED_DIRECTION;
108 
110  static const double LATERAL_OFFSET;
111 
113  double getEdgePos(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
115  Position getPosition(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
117  double getAngle(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
119  double getSpeed(const MSContainer::MSContainerStage_Tranship& stage) const;
121  SUMOTime computeTranshipTime(const MSEdge* prev, const MSContainer::MSContainerStage_Tranship& stage, SUMOTime currentTime);
122 
123 
124 private:
129  Position myCurrentBeginPosition; //the position the container is moving from during its tranship stage
130  Position myCurrentEndPosition; //the position the container is moving to during its tranship stage
131 
132 };
133 
134 
135 #endif /* MSCModel_NonInteracting_h */
136 
Position myCurrentBeginPosition
SUMOTime myCurrentDuration
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:64
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
double myCurrentBeginPos
MoveToNextEdge(MSTransportable *container, MSContainer::MSContainerStage_Tranship &tranship)
Base (microsim) event class.
Definition: Command.h:60
The simulated network and simulation perfomer.
Definition: MSNet.h:90
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:80
static const int BACKWARD
Position myCurrentEndPosition
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
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.
long long int SUMOTime
Definition: TraCIDefs.h:51
The container following model for tranship.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
static const int UNDEFINED_DIRECTION
static MSCModel_NonInteracting * getModel()
static void cleanup()
remove state at simulation end