Eclipse 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-2019 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 /****************************************************************************/
15 // The pedestrian following model (prototype)
16 /****************************************************************************/
17 #ifndef MSPModel_NonInteracting_h
18 #define MSPModel_NonInteracting_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <limits>
27 #include <utils/common/SUMOTime.h>
28 #include <utils/common/Command.h>
29 #include "MSPerson.h"
30 #include "MSPModel.h"
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class MSNet;
36 class MSLink;
37 class MSLane;
38 class MSJunction;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
50 public:
51 
53  MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net);
54 
56 
59 
61  void remove(PedestrianState* state);
62 
65  return false;
66  }
67 
68 private:
69  class MoveToNextEdge : public Command {
70  public:
73  SUMOTime execute(SUMOTime currentTime);
74  void abortWalk() {
75  myPerson = 0;
76  }
77  const MSPerson* getPerson() const {
78  return myPerson;
79  }
80 
81  private:
84  private:
87  };
88 
90  class PState : public PedestrianState {
91  public:
92  PState(MoveToNextEdge* cmd): myCommand(cmd) {};
93 
96  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
97  Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
98  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
99  SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
100  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
101  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
103 
105  SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime);
107  return myCommand;
108  }
109 
110  private:
116 
117  };
118 
119 private:
122 
123 };
124 
125 
126 #endif /* MSPModel_NonInteracting_h */
127 
long long int SUMOTime
Definition: SUMOTime.h:35
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
The base class for an intersection.
Definition: MSJunction.h:61
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:53
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:92
The pedestrian following model.
Definition: MSPModel.h:50
bool usingInternalLanes()
whether movements on intersections are modelled
A road/street connecting two junctions.
Definition: MSEdge.h:76
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:39
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:128
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
A storage for options typed value containers)
Definition: OptionsCont.h:90
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
SUMOTime execute(SUMOTime currentTime)
Executes the command.