46 #define DEBUG1 "disabled" 47 #define DEBUG2 "disabled" 48 #define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) 89 dynamic_cast<PState*
>(state)->getCommand()->abortWalk();
98 PState* state =
dynamic_cast<PState*
>(myParent.getPedestrianState());
99 const MSEdge* old = myParent.getEdge();
100 const bool arrived = myParent.moveToNextEdge(myPerson, currentTime);
115 myLastEntryTime = currentTime;
140 if ((myCurrentDuration %
DELTA_T) > 0) {
143 return myCurrentDuration;
150 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
156 const MSLane* lane = getSidewalk<MSEdge, MSLane>(stage.
getEdge());
167 return stage.
getLanePosition(lane, getEdgePos(stage, now), lateral_offset);
174 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 getMaxSpeed(const MSPerson *person) const
accessors to be used by MSPModel
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 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.