SUMO - Simulation of Urban MObility
MSPModel_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 /****************************************************************************/
17 // The pedestrian following model (prototype)
18 /****************************************************************************/
19 #ifndef MSPModel_NonInteracting_h
20 #define MSPModel_NonInteracting_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <string>
32 #include <limits>
33 #include <utils/common/SUMOTime.h>
34 #include <utils/common/Command.h>
35 #include "MSPerson.h"
36 #include "MSPModel.h"
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class MSNet;
42 class MSLink;
43 class MSLane;
44 class MSJunction;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
56 public:
57 
59  MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net);
60 
62 
65 
67  void remove(PedestrianState* state);
68 
71  return false;
72  }
73 
74 private:
75  class MoveToNextEdge : public Command {
76  public:
79  SUMOTime execute(SUMOTime currentTime);
80  void abortWalk() {
81  myPerson = 0;
82  }
83  const MSPerson* getPerson() const {
84  return myPerson;
85  }
86 
87  private:
90  private:
93  };
94 
96  class PState : public PedestrianState {
97  public:
98  PState(MoveToNextEdge* cmd): myCommand(cmd) {};
99 
102  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
103  Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
104  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
105  SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
106  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
107  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
109 
111  SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime);
113  return myCommand;
114  }
115 
116  private:
122 
123  };
124 
125 private:
128 
129 };
130 
131 
132 #endif /* MSPModel_NonInteracting_h */
133 
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
The base class for an intersection.
Definition: MSJunction.h:64
MSPerson::MSPersonStage_Walking & myParent
abstract base class for managing callbacks to retrieve various state information from the model ...
Base (microsim) event class.
Definition: Command.h:60
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
The simulated network and simulation perfomer.
Definition: MSNet.h:90
The pedestrian following model.
Definition: MSPModel.h:55
bool usingInternalLanes()
whether movements on intersections are modelled
A road/street connecting two junctions.
Definition: MSEdge.h:80
The pedestrian following model.
MSPModel_NonInteracting(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
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
abstract base class for managing callbacks to retrieve various state information from the model ...
Definition: MSPModel.h:131
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
A storage for options typed value containers)
Definition: OptionsCont.h:98
long long int SUMOTime
Definition: TraCIDefs.h:51
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
SUMOTime execute(SUMOTime currentTime)
Executes the command.