SUMO - Simulation of Urban MObility
MSPModel_NonInteracting.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The pedestrian following model (prototype)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2014-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSPModel_NonInteracting_h
21 #define MSPModel_NonInteracting_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <limits>
34 #include <utils/common/SUMOTime.h>
35 #include <utils/common/Command.h>
36 #include "MSPerson.h"
37 #include "MSPModel.h"
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSNet;
43 class MSLink;
44 class MSLane;
45 class MSJunction;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
57 public:
58 
60  MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net);
61 
63 
66 
68  void remove(PedestrianState* state);
69 
71  bool blockedAtDist(const MSLane* lane, double distToCrossing, std::vector<const MSPerson*>* collectBlockers);
72 
73 private:
74  class MoveToNextEdge : public Command {
75  public:
78  SUMOTime execute(SUMOTime currentTime);
79  void abortWalk() {
80  myPerson = 0;
81  }
82 
83  private:
86  private:
89  };
90 
92  class PState : public PedestrianState {
93  public:
94  PState(MoveToNextEdge* cmd): myCommand(cmd) {};
95 
98  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
99  Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
100  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
101  SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
102  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
103  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
105 
107  SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime);
109  return myCommand;
110  }
111 
112  private:
118 
119  };
120 
121 private:
124 
125 };
126 
127 
128 #endif /* MSPModel_NonInteracting_h */
129 
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:61
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:94
The pedestrian following model.
Definition: MSPModel.h:54
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:46
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:96
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
A storage for options typed value containers)
Definition: OptionsCont.h:99
long long int SUMOTime
Definition: TraCIDefs.h:52
bool blockedAtDist(const MSLane *lane, double distToCrossing, std::vector< const MSPerson *> *collectBlockers)
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
SUMOTime execute(SUMOTime currentTime)
Executes the command.