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 /****************************************************************************/
14 // The pedestrian following model (prototype)
15 /****************************************************************************/
16 #ifndef MSPModel_NonInteracting_h
17 #define MSPModel_NonInteracting_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <string>
25 #include <limits>
26 #include <utils/common/SUMOTime.h>
27 #include <utils/common/Command.h>
28 #include "MSPerson.h"
29 #include "MSPModel.h"
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class MSNet;
35 class MSLink;
36 class MSLane;
37 class MSJunction;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
49 public:
50 
52  MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net);
53 
55 
58 
60  void remove(PedestrianState* state);
61 
64  return false;
65  }
66 
67 private:
68  class MoveToNextEdge : public Command {
69  public:
72  SUMOTime execute(SUMOTime currentTime);
73  void abortWalk() {
74  myPerson = 0;
75  }
76  const MSPerson* getPerson() const {
77  return myPerson;
78  }
79 
80  private:
83  private:
86  };
87 
89  class PState : public PedestrianState {
90  public:
92 
95  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
97  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
99  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
100  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
102 
104  SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime);
106  return myCommand;
107  }
108 
109  private:
115 
116  };
117 
118 private:
121 
122 };
123 
124 
125 #endif /* MSPModel_NonInteracting_h */
126 
MSPModel_NonInteracting::MoveToNextEdge::abortWalk
void abortWalk()
Definition: MSPModel_NonInteracting.h:73
MSPModel_NonInteracting::~MSPModel_NonInteracting
~MSPModel_NonInteracting()
Definition: MSPModel_NonInteracting.cpp:56
MSPModel
The pedestrian following model.
Definition: MSPModel.h:52
MSPModel_NonInteracting::PState::myCurrentEndPos
double myCurrentEndPos
Definition: MSPModel_NonInteracting.h:113
MSPModel_NonInteracting
The pedestrian following model.
Definition: MSPModel_NonInteracting.h:48
MSPModel_NonInteracting::PState::getSpeed
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
Definition: MSPModel_NonInteracting.cpp:173
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSJunction
The base class for an intersection.
Definition: MSJunction.h:60
MSPModel_NonInteracting::PState::getPosition
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
Definition: MSPModel_NonInteracting.cpp:139
MSPModel_NonInteracting::MoveToNextEdge::myPerson
MSPerson * myPerson
Definition: MSPModel_NonInteracting.h:82
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
MSPModel_NonInteracting::PState::getCommand
MoveToNextEdge * getCommand()
Definition: MSPModel_NonInteracting.h:105
MSPerson
Definition: MSPerson.h:63
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSPModel_NonInteracting::PState::computeWalkingTime
SUMOTime computeWalkingTime(const MSEdge *prev, const MSPerson::MSPersonStage_Walking &stage, SUMOTime currentTime)
compute walking time on edge and update state members
Definition: MSPModel_NonInteracting.cpp:98
MSPModel_NonInteracting::MoveToNextEdge::myParent
MSPerson::MSPersonStage_Walking & myParent
Definition: MSPModel_NonInteracting.h:81
MSPModel_NonInteracting::PState::getWaitingTime
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
Definition: MSPModel_NonInteracting.cpp:167
PedestrianState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel.h:137
MSPModel_NonInteracting::MoveToNextEdge::MoveToNextEdge
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
Definition: MSPModel_NonInteracting.h:70
MSPModel_NonInteracting::PState::getAngle
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
Definition: MSPModel_NonInteracting.cpp:156
MSPModel_NonInteracting::PState::getNextEdge
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
Definition: MSPModel_NonInteracting.cpp:179
MSPModel_NonInteracting::PState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel_NonInteracting.h:89
MSPModel_NonInteracting::PState::myCurrentBeginPos
double myCurrentBeginPos
Definition: MSPModel_NonInteracting.h:112
MSPModel_NonInteracting::MoveToNextEdge::execute
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Definition: MSPModel_NonInteracting.cpp:79
MSPModel_NonInteracting::PState::myCurrentDuration
SUMOTime myCurrentDuration
Definition: MSPModel_NonInteracting.h:111
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
MSPModel_NonInteracting::MoveToNextEdge::operator=
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
MSPModel_NonInteracting::PState::myCommand
MoveToNextEdge * myCommand
Definition: MSPModel_NonInteracting.h:114
MSPModel_NonInteracting::MoveToNextEdge::getPerson
const MSPerson * getPerson() const
Definition: MSPModel_NonInteracting.h:76
MSPModel_NonInteracting::remove
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
Definition: MSPModel_NonInteracting.cpp:73
MSPModel_NonInteracting::usingInternalLanes
bool usingInternalLanes()
whether movements on intersections are modelled
Definition: MSPModel_NonInteracting.h:63
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSPerson.h
MSPModel_NonInteracting::PState::myLastEntryTime
SUMOTime myLastEntryTime
Definition: MSPModel_NonInteracting.h:110
MSPModel_NonInteracting::PState::getEdgePos
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
Definition: MSPModel_NonInteracting.cpp:132
MSPModel_NonInteracting::MoveToNextEdge::~MoveToNextEdge
~MoveToNextEdge()
Definition: MSPModel_NonInteracting.h:71
Command
Base (microsim) event class.
Definition: Command.h:52
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:70
MSPModel.h
MSPModel_NonInteracting::MoveToNextEdge
Definition: MSPModel_NonInteracting.h:68
MSPModel_NonInteracting::MSPModel_NonInteracting
MSPModel_NonInteracting(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
Definition: MSPModel_NonInteracting.cpp:49
config.h
Command.h
MSPModel_NonInteracting::PState::PState
PState(MoveToNextEdge *cmd)
Definition: MSPModel_NonInteracting.h:91
MSPModel_NonInteracting::myNet
MSNet * myNet
the net to which to issue moveToNextEdge commands
Definition: MSPModel_NonInteracting.h:120
MSPModel_NonInteracting::add
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
Definition: MSPModel_NonInteracting.cpp:61