47 #define DEBUG1 "disabled" 48 #define DEBUG2 "disabled" 49 #define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) 90 dynamic_cast<PState*
>(state)->getCommand()->abortWalk();
99 PState* state =
dynamic_cast<PState*
>(myParent.getPedestrianState());
100 const MSEdge* old = myParent.getEdge();
101 const bool arrived = myParent.moveToNextEdge(myPerson, currentTime);
116 myLastEntryTime = currentTime;
139 return myCurrentDuration;
146 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
152 const MSLane* lane = getSidewalk<MSEdge, MSLane>(stage.
getEdge());
163 return stage.
getLanePosition(lane, getEdgePos(stage, now), lateral_offset);
170 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
double getLength() const
return the length of the edge
double getDepartPos() const
bool lefthand() const
return whether the network was built for lefthand traffic
~MSPModel_NonInteracting()
const MSEdge * getNextRouteEdge() const
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
double getArrivalPos() const
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
SUMOTime computeWalkingTime(const MSEdge *prev, const MSPerson::MSPersonStage_Walking &stage, SUMOTime currentTime)
compute walking time on edge and update state members
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 ...
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.
const MSEdge * getEdge() const
Returns the current edge.
A road/street connecting two junctions.
static const int UNDEFINED_DIRECTION
bool allowsVehicleClass(SUMOVehicleClass vclass) const
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
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.
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
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
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
abstract base class for managing callbacks to retrieve various state information from the model ...
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
double getMaxSpeed() const
accessors to be used by MSPModel
A storage for options typed value containers)
static const int BACKWARD
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
const MSJunction * getFromJunction() const
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
SUMOTime execute(SUMOTime currentTime)
Executes the command.
const MSJunction * getToJunction() const