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 
70 private:
71  class MoveToNextEdge : public Command {
72  public:
75  SUMOTime execute(SUMOTime currentTime);
76  void abortWalk() {
77  myPerson = 0;
78  }
79 
80  private:
83  private:
86  };
87 
89  class PState : public PedestrianState {
90  public:
91  PState(MoveToNextEdge* cmd): myCommand(cmd) {};
92 
95  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
96  Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
97  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
98  SUMOTime getWaitingTime(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 
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:89
The pedestrian following model.
Definition: MSPModel.h:56
A road/street connecting two junctions.
Definition: MSEdge.h:81
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:129
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
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
SUMOTime execute(SUMOTime currentTime)
Executes the command.