 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 #define DEBUG1 "disabled"
42 #define DEBUG2 "disabled"
43 #define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2)
75 dynamic_cast<PState*>(state)->getCommand()->abortWalk();
100 myLastEntryTime = currentTime;
104 if (prev ==
nullptr) {
111 if (next ==
nullptr) {
125 if ((myCurrentDuration %
DELTA_T) > 0) {
128 return myCurrentDuration;
135 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
141 const MSLane* lane = getSidewalk<MSEdge, MSLane>(stage.
getEdge());
142 if (lane ==
nullptr) {
152 return stage.
getLanePosition(lane, getEdgePos(stage, now), lateral_offset);
159 double angle = stage.
getEdgeAngle(stage.
getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ?
M_PI : 0);
#define UNUSED_PARAMETER(x)
~MSPModel_NonInteracting()
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
static const int BACKWARD
Representation of a lane in the micro simulation.
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
double getDepartPos() const
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
The simulated network and simulation perfomer.
SUMOTime computeWalkingTime(const MSEdge *prev, const MSPerson::MSPersonStage_Walking &stage, SUMOTime currentTime)
compute walking time on edge and update state members
MSPerson::MSPersonStage_Walking & myParent
double getLength() const
return the length of the edge
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
abstract base class for managing callbacks to retrieve various state information from the model
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
const MSJunction * getFromJunction() const
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
abstract base class for managing callbacks to retrieve various state information from the model
SUMOTime execute(SUMOTime currentTime)
Executes the command.
bool lefthand() const
return whether the network was built for lefthand traffic
double getMaxSpeed(const MSTransportable *const person) const
accessors to be used by MSPModel
A point in 2D or 3D with translation and scaling methods.
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
A storage for options typed value containers)
A road/street connecting two junctions.
const MSJunction * getToJunction() const
double getArrivalPos() const
bool allowsVehicleClass(SUMOVehicleClass vclass) const
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool moveToNextEdge(MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=nullptr)
move forward and return whether the person arrived
static const double SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
static const int UNDEFINED_DIRECTION
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
MSPModel_NonInteracting(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
MSNet * myNet
the net to which to issue moveToNextEdge commands
const MSEdge * getEdge() const
Returns the current edge.
const MSEdge * getNextRouteEdge() const
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
PedestrianState * getPedestrianState() const