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:
93 
96  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
98  double getAngle(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 
MSPModel_NonInteracting::MoveToNextEdge::abortWalk
void abortWalk()
Definition: MSPModel_NonInteracting.h:74
MSPModel_NonInteracting::~MSPModel_NonInteracting
~MSPModel_NonInteracting()
Definition: MSPModel_NonInteracting.cpp:57
MSPModel
The pedestrian following model.
Definition: MSPModel.h:50
MSPModel_NonInteracting::PState::myCurrentEndPos
double myCurrentEndPos
Definition: MSPModel_NonInteracting.h:114
MSPModel_NonInteracting
The pedestrian following model.
Definition: MSPModel_NonInteracting.h:49
MSPModel_NonInteracting::PState::getSpeed
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
Definition: MSPModel_NonInteracting.cpp:174
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSJunction
The base class for an intersection.
Definition: MSJunction.h:61
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:140
MSPModel_NonInteracting::MoveToNextEdge::myPerson
MSPerson * myPerson
Definition: MSPModel_NonInteracting.h:83
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
MSPModel_NonInteracting::PState::getCommand
MoveToNextEdge * getCommand()
Definition: MSPModel_NonInteracting.h:106
MSPerson
Definition: MSPerson.h:64
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
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:99
MSPModel_NonInteracting::MoveToNextEdge::myParent
MSPerson::MSPersonStage_Walking & myParent
Definition: MSPModel_NonInteracting.h:82
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:168
PedestrianState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel.h:128
MSPModel_NonInteracting::MoveToNextEdge::MoveToNextEdge
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
Definition: MSPModel_NonInteracting.h:71
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:157
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:180
MSPModel_NonInteracting::PState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel_NonInteracting.h:90
MSPModel_NonInteracting::PState::myCurrentBeginPos
double myCurrentBeginPos
Definition: MSPModel_NonInteracting.h:113
MSPModel_NonInteracting::MoveToNextEdge::execute
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Definition: MSPModel_NonInteracting.cpp:80
MSPModel_NonInteracting::PState::myCurrentDuration
SUMOTime myCurrentDuration
Definition: MSPModel_NonInteracting.h:112
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
MSPModel_NonInteracting::MoveToNextEdge::operator=
MoveToNextEdge & operator=(const MoveToNextEdge &)
Invalidated assignment operator.
MSPModel_NonInteracting::PState::myCommand
MoveToNextEdge * myCommand
Definition: MSPModel_NonInteracting.h:115
MSPModel_NonInteracting::MoveToNextEdge::getPerson
const MSPerson * getPerson() const
Definition: MSPModel_NonInteracting.h:77
MSPModel_NonInteracting::remove
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
Definition: MSPModel_NonInteracting.cpp:74
MSPModel_NonInteracting::usingInternalLanes
bool usingInternalLanes()
whether movements on intersections are modelled
Definition: MSPModel_NonInteracting.h:64
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSPerson.h
MSPModel_NonInteracting::PState::myLastEntryTime
SUMOTime myLastEntryTime
Definition: MSPModel_NonInteracting.h:111
MSPModel_NonInteracting::PState::getEdgePos
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
Definition: MSPModel_NonInteracting.cpp:133
MSPModel_NonInteracting::MoveToNextEdge::~MoveToNextEdge
~MoveToNextEdge()
Definition: MSPModel_NonInteracting.h:72
Command
Base (microsim) event class.
Definition: Command.h:53
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:71
MSPModel.h
MSPModel_NonInteracting::MoveToNextEdge
Definition: MSPModel_NonInteracting.h:69
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:50
config.h
Command.h
MSPModel_NonInteracting::PState::PState
PState(MoveToNextEdge *cmd)
Definition: MSPModel_NonInteracting.h:92
MSPModel_NonInteracting::myNet
MSNet * myNet
the net to which to issue moveToNextEdge commands
Definition: MSPModel_NonInteracting.h:121
MSPModel_NonInteracting::add
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
Definition: MSPModel_NonInteracting.cpp:62