41 #define DEBUG1 "disabled" 42 #define DEBUG2 "disabled" 43 #define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) 84 dynamic_cast<PState*
>(state)->getCommand()->abortWalk();
90 if (myPerson ==
nullptr) {
93 PState* state =
dynamic_cast<PState*
>(myParent.getPedestrianState());
94 const MSEdge* old = myParent.getEdge();
95 const bool arrived = myParent.moveToNextEdge(myPerson, currentTime);
109 myLastEntryTime = currentTime;
113 if (prev ==
nullptr) {
120 if (next ==
nullptr) {
134 if ((myCurrentDuration %
DELTA_T) > 0) {
137 return myCurrentDuration;
144 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
150 const MSLane* lane = getSidewalk<MSEdge, MSLane>(stage.
getEdge());
151 if (lane ==
nullptr) {
161 return stage.
getLanePosition(lane, getEdgePos(stage, now), lateral_offset);
168 double angle = stage.
getEdgeAngle(stage.
getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ?
M_PI : 0);
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
~MSPModel_NonInteracting()
SUMOTime computeWalkingTime(const MSEdge *prev, const MSPerson::MSPersonStage_Walking &stage, SUMOTime currentTime)
compute walking time on edge and update state members
double getDepartPos() const
const MSEdge * getEdge() const
Returns the current edge.
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
abstract base class for managing callbacks to retrieve various state information from the model ...
static const double SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk ...
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
double getLength() const
return the length of the edge
const MSJunction * getToJunction() const
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
#define UNUSED_PARAMETER(x)
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
The simulated network and simulation perfomer.
A road/street connecting two junctions.
static const int UNDEFINED_DIRECTION
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.
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
MSNet * myNet
the net to which to issue moveToNextEdge commands
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
double getMaxSpeed(const MSTransportable *const person) const
accessors to be used by MSPModel
double getArrivalPos() const
bool lefthand() const
return whether the network was built for lefthand traffic
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 ...
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
const MSJunction * getFromJunction() const
A storage for options typed value containers)
bool allowsVehicleClass(SUMOVehicleClass vclass) const
static const int BACKWARD
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
const MSEdge * getNextRouteEdge() const
Representation of a lane in the micro simulation.
SUMOTime execute(SUMOTime currentTime)
Executes the command.