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-2016 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  bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector<const MSPerson*>* collectBlockers);
69 
70 private:
71  class MoveToNextEdge : public Command {
72  public:
75  SUMOTime execute(SUMOTime currentTime);
76 
77  private:
80  private:
83  };
84 
86  class PState : public PedestrianState {
87  public:
88  PState() {};
89 
92  SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
93  Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
94  SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
95  SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
96  SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
97  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
99 
101  SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime);
102 
103 
104  private:
109 
110  };
111 
112 private:
115 
116 };
117 
118 
119 #endif /* MSPModel_NonInteracting_h */
120 
bool blockedAtDist(const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson * > *collectBlockers)
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
long long int SUMOTime
Definition: SUMOTime.h:43
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:93
MoveToNextEdge(MSPerson *person, MSPerson::MSPersonStage_Walking &walk)
A storage for options typed value containers)
Definition: OptionsCont.h:108
#define SUMOReal
Definition: config.h:213
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
SUMOTime execute(SUMOTime currentTime)
Executes the command.