SUMO - Simulation of Urban MObility
MSCModel_NonInteracting.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The container following model for tranship (prototype)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2014-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSCModel_NonInteracting_h
22 #define MSCModel_NonInteracting_h
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <limits>
35 #include <utils/common/SUMOTime.h>
36 #include <utils/common/Command.h>
37 #include <microsim/MSContainer.h>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MSNet;
44 class MSLink;
45 class MSLane;
46 class MSJunction;
47 class CState;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
59 public:
60 
63 
65 
67 
69  static void cleanup();
70 
73 
74 private:
76 
77 private:
78  class MoveToNextEdge : public Command {
79  public:
82  SUMOTime execute(SUMOTime currentTime);
83 
84  private:
87  private:
90  };
91 
92 
93 private:
96 
97 };
98 
99 class CState {
100 public:
101  CState() {};
102 
103  ~CState() {};
104 
105  // @brief walking directions
106  static const int FORWARD;
107  static const int BACKWARD;
108  static const int UNDEFINED_DIRECTION;
109 
111  static const SUMOReal LATERAL_OFFSET;
112 
114  SUMOReal getEdgePos(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
116  Position getPosition(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
118  SUMOReal getAngle(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const;
120  SUMOReal getSpeed(const MSContainer::MSContainerStage_Tranship& stage) const;
122  SUMOTime computeTranshipTime(const MSEdge* prev, const MSContainer::MSContainerStage_Tranship& stage, SUMOTime currentTime);
123 
124 
125 private:
130  Position myCurrentBeginPosition; //the position the container is moving from during its tranship stage
131  Position myCurrentEndPosition; //the position the container is moving to during its tranship stage
132 
133 };
134 
135 
136 #endif /* MSCModel_NonInteracting_h */
137 
Position myCurrentBeginPosition
SUMOTime myCurrentDuration
long long int SUMOTime
Definition: SUMOTime.h:43
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.
MoveToNextEdge(MSTransportable *container, MSContainer::MSContainerStage_Tranship &tranship)
Base (microsim) event class.
Definition: Command.h:61
The simulated network and simulation perfomer.
Definition: MSNet.h:93
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
SUMOReal myCurrentBeginPos
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
MSNet * myNet
the net to which to issue moveToNextEdge commands
MSContainer::MSContainerStage_Tranship & myParent
SUMOReal myCurrentEndPos
SUMOTime myLastEntryTime
SUMOTime execute(SUMOTime currentTime)
Executes the command.
#define SUMOReal
Definition: config.h:213
The container following model for tranship.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
static const int UNDEFINED_DIRECTION
static MSCModel_NonInteracting * getModel()
static void cleanup()
remove state at simulation end
static const SUMOReal LATERAL_OFFSET
the offset for computing container positions when being transhiped