51 #define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2)
55 for (
int i = 0; i < (int)obs.size(); ++i) {
57 <<
"(" << obs[i].description
58 <<
" x=(" << obs[i].xBack <<
"," << obs[i].xFwd
59 <<
") s=" << obs[i].speed
70 #define DIST_FAR_AWAY 10000
71 #define DIST_BEHIND 1000
72 #define DIST_OVERLAP -1
107 myNumActivePedestrians(0) {
129 const MSLane* lane = getSidewalk<MSEdge, MSLane>(person->
getEdge());
140 for (Pedestrians::const_iterator it_ped = pedestrians.begin(); it_ped != pedestrians.end(); ++it_ped) {
141 const PState& ped = **it_ped;
142 const SUMOReal halfVehicleWidth = 1.0;
150 if (collectBlockers == 0) {
153 collectBlockers->push_back(ped.
myPerson);
157 if (collectBlockers == 0) {
160 return collectBlockers->size() > 0;
180 for (Pedestrians::iterator it_p = it_lane->second.begin(); it_p != it_lane->second.end(); ++it_p) {
197 if (from == 0 || to == 0) {
217 const MSLane* walkingArea = getSidewalk<MSEdge, MSLane>(edge);
220 std::vector<const MSLane*> lanes;
222 for (
int j = 0; j < (int)incoming.size(); ++j) {
223 lanes.push_back(getSidewalk<MSEdge, MSLane>(incoming[j]));
226 for (
int j = 0; j < (int)outgoing.size(); ++j) {
227 lanes.push_back(getSidewalk<MSEdge, MSLane>(outgoing[j]));
230 for (
int j = 0; j < (int)lanes.size(); ++j) {
231 for (
int k = 0; k < (int)lanes.size(); ++k) {
234 const MSLane* from = lanes[j];
235 const MSLane* to = lanes[k];
244 shape.push_back(fromPos);
254 if (shape.size() < 2) {
258 assert(shape.size() == 2);
278 const MSLane* nextRouteLane = getSidewalk<MSEdge, MSLane>(nextRouteEdge);
280 const MSLane* nextLane = nextRouteLane;
284 if (nextRouteLane != 0) {
289 std::cout <<
" internal\n";
294 nextLane = currentLane->
getLinkCont()[0]->getLane();
299 std::cout <<
" crossing\n";
310 prohibited.push_back(&prevLane->
getEdge());
314 <<
" nre=" << nextRouteEdge->
getID()
315 <<
" nreDir=" << nextRouteEdgeDir
316 <<
" aPos=" << arrivalPos
317 <<
" crossingRoute=" <<
toString(crossingRoute)
320 if (crossingRoute.size() > 1) {
321 const MSEdge* nextEdge = crossingRoute[1];
322 nextLane = getSidewalk<MSEdge, MSLane>(crossingRoute[1]);
324 assert(nextLane != prevLane);
327 std::cout <<
" nextDir=" << nextDir <<
"\n";
342 <<
" no route from '" << (currentEdge == 0 ?
"NULL" : currentEdge->
getID())
343 <<
"' to '" << (nextRouteEdge == 0 ?
"NULL" : nextRouteEdge->
getID())
350 }
else if (currentEdge == nextRouteEdge) {
352 nextDir = -ped.
myDir;
360 std::cout <<
" next walkingArea " << (nextDir ==
FORWARD ?
"forward" :
"backward") <<
"\n";
369 #ifdef HAVE_INTERNAL_LANES
372 std::cout <<
" direct forward\n";
374 nextLane = MSLinkContHelper::getInternalFollowingLane(currentLane, nextRouteLane);
379 #ifdef HAVE_INTERNAL_LANES
382 std::cout <<
" direct backward\n";
384 nextLane = MSLinkContHelper::getInternalFollowingLane(nextRouteLane, currentLane);
391 nextLane = nextRouteLane;
393 std::cout <<
SIMTIME <<
" no next lane found for " << currentLane->
getID() <<
" dir=" << ped.
myDir <<
"\n";
397 nextLane = nextRouteLane;
404 <<
" l=" << currentLane->
getID()
405 <<
" nl=" << (nextLane == 0 ?
"NULL" : nextLane->getID())
406 <<
" nrl=" << (nextRouteLane == 0 ?
"NULL" : nextRouteLane->
getID())
409 <<
" pedDir=" << ped.
myDir
420 for (MSLinkCont::const_iterator it = links.begin(); it != links.end(); ++it) {
421 if ((*it)->getLane()->getEdge().isWalkingArea()) {
427 const std::vector<MSLane::IncomingLaneInfo>& laneInfos = currentLane->
getIncomingLanes();
428 for (std::vector<MSLane::IncomingLaneInfo>::const_iterator it = laneInfos.begin(); it != laneInfos.end(); ++it) {
429 if ((*it).lane->getEdge().isWalkingArea()) {
430 link = (*it).viaLink;
441 const PState& ego = *pedestrians[egoIndex];
443 std::vector<bool> haveBlocker(stripes,
false);
444 for (
int index = egoIndex + 1; index < (int)pedestrians.size(); index++) {
445 const PState& p = *pedestrians[index];
452 std::cout <<
" dist=" << ego.
distanceTo(o) << std::endl;
460 haveBlocker[p.
stripe()] =
true;
463 if (!haveBlocker[p.
stripe()]) {
482 SUMOReal currentLength,
int currentDir) {
483 if (nextLanesObs.count(nextLane) == 0) {
495 if (nextStripes < stripes) {
496 int offset = (stripes - nextStripes) / 2;
497 if (currentDir == nextDir) {
499 offset += (stripes - nextStripes) % 2;
502 for (
int ii = 0; ii < stripes; ++ii) {
503 if (ii < offset || ii >= nextStripes + offset) {
504 obs[ii] =
Obstacle(nextDir ==
FORWARD ? 0 : nextLength, 0,
"stripeEnd");
513 nextDir = currentDir;
515 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
516 PState& p = *pedestrians[ii];
518 const SUMOReal newY = relPos.
y() + lateral_offset;
526 sort(pedestrians.begin(), pedestrians.end(),
by_xpos_sorter(nextDir));
527 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
528 const PState& p = *pedestrians[ii];
533 if (nextDir != currentDir) {
537 const int stripe = p.
stripe(newY);
538 if (stripe >= 0 && stripe < stripes) {
542 if (otherStripe >= 0 && otherStripe < stripes) {
546 for (
int ii = 0; ii < stripes; ++ii) {
554 o.
xFwd += currentLength;
555 o.
xBack += currentLength;
563 nextLanesObs[nextLane] = obs;
565 return nextLanesObs[nextLane];
571 if (stripe >= 0 && stripe < numStripes) {
572 if ((dir ==
FORWARD && x - width / 2. < obs[stripe].xBack) || (dir ==
BACKWARD && x + width / 2. > obs[stripe].xFwd)) {
573 obs[stripe] =
Obstacle(x, 0,
id, width);
581 const MSLane* lane = it_lane->first;
591 std::set<const WalkingAreaPath*, walkingarea_path_sorter> paths;
592 for (Pedestrians::iterator it = pedestrians.begin(); it != pedestrians.end(); ++it) {
595 if (p->
myDir == dir) {
599 std::cout <<
SIMTIME <<
" debugging WalkingAreaPath from=" << debugPath->
from->
getID() <<
" to=" << debugPath->
to->
getID() <<
"\n";
603 for (std::set<const WalkingAreaPath*, walkingarea_path_sorter>::iterator it = paths.begin(); it != paths.end(); ++it) {
607 transformedPeds.reserve(pedestrians.size());
608 for (Pedestrians::iterator it_p = pedestrians.begin(); it_p != pedestrians.end(); ++it_p) {
613 transformedPeds.push_back(p);
614 if (path == debugPath) std::cout <<
" ped=" << p->
myPerson->
getID() <<
" relX=" << p->
myRelX <<
" relY=" << p->
myRelY <<
" (untransformed), vecCoord="
618 const SUMOReal newY = relPos.
y() + lateral_offset;
626 toDelete.push_back(tp);
627 transformedPeds.push_back(tp);
628 if (path == debugPath) {
629 std::cout <<
" ped=" << p->
myPerson->
getID() <<
" relX=" << relPos.
x() <<
" relY=" << newY <<
" (transformed), vecCoord=" << relPos <<
"\n";
632 if (path == debugPath) {
633 std::cout <<
" ped=" << p->
myPerson->
getID() <<
" relX=" << relPos.
x() <<
" relY=" << newY <<
" (invalid), vecCoord=" << relPos <<
"\n";
640 for (Pedestrians::iterator it_p = toDelete.begin(); it_p != toDelete.end(); ++it_p) {
648 sort(pedestrians.begin(), pedestrians.end(),
by_xpos_sorter(dir));
649 for (Pedestrians::iterator it = pedestrians.begin(); it != pedestrians.end();) {
651 if (p->
myDir != dir) {
656 it = pedestrians.erase(it);
678 sort(pedestrians.begin(), pedestrians.end(),
by_xpos_sorter(dir));
679 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
680 PState& p = *pedestrians[ii];
704 nextLanesObs, lane, nextLane, stripes,
747 p.
walk(currentObs, currentTime);
754 for (
int coll = 0; coll < ii; ++coll) {
755 PState& c = *pedestrians[coll];
762 +
"', lane='" + lane->
getID() +
"', time=" +
time2string(currentTime) +
".");
786 description(ped.myPerson->getID()) {
803 myRelX(stage->getDepartPos()),
807 myWaitingToEnter(true),
809 myWalkingAreaPath(0),
814 if (route.size() == 1) {
821 std::cout <<
" initialize dir for " <<
myPerson->
getID() <<
" forward=" << mayStartForward <<
" backward=" << mayStartBackward <<
"\n";
823 if (mayStartForward && mayStartBackward) {
827 if (crossingRoute.size() > 1) {
829 const MSEdge* nextEdge = crossingRoute[1];
835 std::cout <<
" crossingRoute=" <<
toString(crossingRoute) <<
"\n";
857 return myRelX - getLength();
859 return myRelX - (includeMinGap ? getMinGap() : 0.);
867 return myRelX + (includeMinGap ? getMinGap() : 0.);
869 return myRelX + getLength();
875 return myPerson->getVehicleType().getLength();
881 return myPerson->getVehicleType().getMinGap();
893 const int s = stripe(relY);
897 if (offset > threshold) {
899 }
else if (offset < -threshold) {
924 if (myStage->getNextRouteEdge() == 0) {
925 return myDir * (myStage->getArrivalPos() - myRelX) -
POSITION_EPS;
927 const SUMOReal length = myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length;
928 return myDir ==
FORWARD ? length - myRelX : myRelX;
935 const SUMOReal dist = distToLaneEnd();
936 if (myPerson->getID() ==
DEBUG1) {
937 std::cout <<
SIMTIME <<
" myRelX=" << myRelX <<
" dist=" << dist <<
"\n";
945 const int oldDir = myDir;
946 const MSLane* oldLane = myLane;
952 <<
" ped=" << myPerson->getID()
953 <<
" moveToNextLane old=" << oldLane->
getID()
954 <<
" new=" << (myLane == 0 ?
"NULL" : myLane->getID())
955 <<
" oldDir=" << oldDir
956 <<
" newDir=" << myDir
960 myRelX = myStage->getArrivalPos();
962 myStage->moveToNextEdge(myPerson, currentTime, normalLane ? 0 : &myLane->getEdge());
966 assert(myNLI.lane != oldLane);
968 std::cout <<
" nextLane=" << (myNLI.lane == 0 ?
"NULL" : myNLI.lane->getID()) <<
"\n";
970 if (myLane->getEdge().isWalkingArea()) {
973 assert(myWalkingAreaPath->from != 0);
974 assert(myWalkingAreaPath->to != 0);
975 assert(myWalkingAreaPath->shape.size() >= 2);
977 std::cout <<
" mWAPath shape=" << myWalkingAreaPath->shape <<
" length=" << myWalkingAreaPath->length <<
"\n";
982 myStage->moveToNextEdge(myPerson, currentTime, 0);
987 myWalkingAreaPath = 0;
989 throw ProcessError(
"Disconnected walk for person '" + myPerson->getID() +
"'.");
993 myWalkingAreaPath = 0;
997 const SUMOReal newLength = (myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length);
998 myRelX = newLength + dist;
1003 if (myDir != oldDir) {
1007 myRelY += 0.5 * (myLane->getWidth() - oldLane->
getWidth());
1018 const int stripes = (int)obs.size();
1019 const int sMax = stripes - 1;
1021 const SUMOReal vMax = myStage->getMaxSpeed();
1023 const int current = stripe();
1024 const int other = otherStripe();
1026 std::vector<SUMOReal> utility(stripes);
1028 for (
int i = 0; i < stripes; ++i) {
1032 std::vector<SUMOReal> distance(stripes);
1033 for (
int i = 0; i < stripes; ++i) {
1034 distance[i] = distanceTo(obs[i]);
1037 for (
int i = 0; i < stripes; ++i) {
1039 if (i == current && !myWaitingToEnter) {
1043 for (
int j = 0; j <= i; ++j) {
1048 for (
int j = i; j < stripes; ++j) {
1059 for (
int i = 0; i < reserved; ++i) {
1063 for (
int i = sMax; i > sMax - reserved; --i) {
1068 for (
int i = 0; i < stripes; ++i) {
1069 if (obs[i].speed < 0) {
1071 if (myDir ==
FORWARD && i > 0) {
1072 utility[i - 1] -= 0.5;
1073 }
else if (myDir ==
BACKWARD && i < sMax) {
1074 utility[i + 1] -= 0.5;
1082 std::cout <<
" util=" << utility[i] <<
" exp=" << expectedDist <<
"\n";
1084 if (expectedDist >= 0) {
1085 utility[i] += expectedDist;
1093 if (((myDir ==
FORWARD && current == sMax)
1094 || (myDir ==
BACKWARD && current == 0))
1095 && obs[current].speed * myDir < 0) {
1100 if (((myDir ==
BACKWARD && current == sMax)
1101 || (myDir ==
FORWARD && current == 0))
1102 && obs[current].speed * myDir < 0) {
1107 int chosen = current;
1108 for (
int i = 0; i < stripes; ++i) {
1109 if (utility[chosen] < utility[i]) {
1114 const int next = (chosen == current ? current : (chosen < current ? current - 1 : current + 1));
1115 const SUMOReal xDist =
MIN3(distance[current], distance[other], distance[next]);
1123 std::cout <<
" xSpeedPotential=" << xSpeed <<
"\n";
1131 if (myWaitingTime >
jamTime || myAmJammed) {
1136 +
"' is jammed on edge '" + myStage->getEdge()->getID()
1166 ySpeed = (yDist > 0 ?
1174 <<
" ped=" << myPerson->getID()
1175 <<
" edge=" << myStage->getEdge()->getID()
1179 <<
" pvx=" << mySpeed
1180 <<
" cur=" << current
1181 <<
" cho=" << chosen
1185 <<
" dawdle=" << dawdle
1189 <<
" vMax=" << myStage->getMaxSpeed()
1190 <<
" wTime=" << myStage->getWaitingTime(currentTime)
1191 <<
" jammed=" << myAmJammed
1192 <<
"\n distance=" <<
toString(distance)
1193 <<
"\n utility=" <<
toString(utility)
1201 myWaitingToEnter =
false;
1212 myPerson->getVehicleType().getImpatience()
1230 if (myWalkingAreaPath == 0) {
1233 return myWalkingAreaPath->shape.positionAtOffset(myRelX, lateral_offset);
1244 const PositionVector& shp = myWalkingAreaPath == 0 ? myLane->getShape() : myWalkingAreaPath->shape;
1255 return myWaitingTime;
1267 return myNLI.lane == 0 ? 0 : &myNLI.lane->getEdge();
1274 const SUMOReal maxX = getMaxX(includeMinGap);
1275 const SUMOReal minX = getMinX(includeMinGap);
1276 if ((obs.
xFwd >= maxX && obs.
xBack <= maxX) || (obs.
xFwd <= maxX && obs.
xFwd >= minX)) {
1289 for (
int i = 0; i < (int)into.size(); ++i) {
1291 std::cout <<
" i=" << i <<
" intoDist=" << distanceTo(into[i]) <<
" obs2Dist=" << distanceTo(obs2[i]) <<
"\n";
1293 if (distanceTo(obs2[i]) < distanceTo(into[i])) {
1308 std::set<MSPerson*> changedLane;
1313 for (ActiveLanes::const_iterator it_lane =
myModel->getActiveLanes().begin(); it_lane !=
myModel->getActiveLanes().end(); ++it_lane) {
1314 const MSLane* lane = it_lane->first;
1316 if (pedestrians.size() == 0) {
1321 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
1322 const PState& p = *pedestrians[ii];
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir)
bool gDebugFlag1
global utility flags for debugging
static NextLaneInfo getNextLane(const PState &ped, const MSLane *currentLane, const MSLane *prevLane)
computes the successor lane for the given pedestrian and sets the link as well as the direction to us...
bool blockedAtDist(const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson * > *collectBlockers)
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
MSEdge & getEdge() const
Returns the lane's edge.
static const SUMOReal OBSTRUCTED_PENALTY
static const SUMOReal SAFETY_GAP
SUMOReal rotationAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
const MSEdge * getNextRouteEdge() const
SUMOReal distToLaneEnd() const
the absolute distance to the end of the lane in walking direction (or to the arrivalPos) ...
MSPerson::MSPersonStage_Walking * myStage
static SUMOReal stripeWidth
model parameters
static int numStripes(const MSLane *lane)
return the maximum number of pedestrians walking side by side
static Obstacles getNeighboringObstacles(const Pedestrians &pedestrians, int egoIndex, int stripes)
sorts the persons by position on the lane. If dir is forward, higher x positions come first...
SUMOReal mySpeed
the current walking speed
bool compute(const E *from, const E *to, SUMOReal departPos, SUMOReal arrivalPos, SUMOReal speed, SUMOTime msTime, const N *onlyNode, std::vector< const E * > &into, bool allEdges=false)
Builds the route between the given edges using the minimum effort at the given time The definition of...
static const MSLane * getNextWalkingArea(const MSLane *currentLane, const int dir, MSLink *&link)
return the next walkingArea in the given direction
static int connectedDirection(const MSLane *from, const MSLane *to)
returns the direction in which these lanes are connectioned or 0 if they are not
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
information regarding surround Pedestrians (and potentially other things)
SUMOReal getLength() const
Returns the lane's length.
The base class for an intersection.
SUMOReal distanceTo(const Obstacle &obs, const bool includeMinGap=true) const
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
bool isWalkingArea() const
return whether this edge is walking area
PState(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, const MSLane *lane)
static SUMOReal rand()
Returns a random real number in [0, 1)
std::string time2string(SUMOTime t)
MSPedestrianRouterDijkstra & getPedestrianRouter(const MSEdgeVector &prohibited=MSEdgeVector()) const
SUMOReal getWidth() const
Returns the lane's width.
static const SUMOReal ONCOMING_CONFLICT_PENALTY
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
returns the id of the transportable
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
std::vector< const MSEdge * > ConstMSEdgeVector
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
bool moveToNextLane(SUMOTime currentTime)
return whether this pedestrian has passed the end of the current lane and update myRelX if so ...
static void addCloserObstacle(Obstacles &obs, SUMOReal x, int stripe, int numStripes, const std::string &id, SUMOReal width, int dir)
const MSEdgeVector & getIncomingEdges() const
Returns the list of edges from which this edge may be reached.
static MSPModel * myModel
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
SUMOReal x() const
Returns the x-position.
#define WRITE_WARNING(msg)
The simulated network and simulation perfomer.
bool myAmJammed
whether the person is jammed
static OptionsCont & getOptions()
Retrieves the options.
static Pedestrians noPedestrians
empty pedestrian vector
static bool gCheck4Accidents
static const SUMOReal RESERVE_FOR_ONCOMING_FACTOR
PositionVector reverse() const
void moveInDirection(SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move all pedestrians forward and advance to the next lane if applicable
void mergeObstacles(Obstacles &into, const Obstacles &obs2)
replace obstacles in the first vector with obstacles from the second if they are closer to me ...
NextLaneInfo myNLI
information about the upcoming lane
const MSEdge & getDestination() const
returns the destination edge
static const SUMOReal SQUEEZE
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
SUMOReal getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
Position getLanePosition(const MSLane *lane, SUMOReal at, SUMOReal offset) const
get position on lane at length at with orthogonal offset
static const SUMOReal LOOKAHEAD_SAMEDIR
static const int UNDEFINED_DIRECTION
SUMOReal getLength() const
return the length of the edge
const MSVehicleType & getVehicleType() const
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
const MSEdge * getEdge() const
Returns the current edge.
static const SUMOReal LATERAL_SPEED_FACTOR
SUMOTime execute(SUMOTime currentTime)
Executes the command.
void walk(const Obstacles &obs, SUMOTime currentTime)
perform position update
A point in 2D or 3D with translation and scaling methods.
static const SUMOReal LOOKAHEAD_ONCOMING
const ConstMSEdgeVector & getRoute() const
MSLane * getLane() const
Returns the connected lane.
static const SUMOReal INAPPROPRIATE_PENALTY
SUMOReal xFwd
maximal position on the current lane in forward direction
static const SUMOReal OBSTRUCTION_THRESHOLD
StageType getCurrentStageType() const
the current stage type of the transportable
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
SUMOReal getLength() const
return the length of the pedestrian
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
SUMOTime string2time(const std::string &r)
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
SUMOReal getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool isInternal() const
return whether this edge is an internal edge
int myDir
the walking direction on the current lane (1 forward, -1 backward)
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
void cleanupHelper()
remove state at simulation end
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
static const SUMOReal MIN_STARTUP_DIST
abstract base class for managing callbacks to retrieve various state information from the model ...
SUMOReal getArrivalPos() const
void registerJammed()
register a jammed person
SUMOReal getWidth() const
Get the width which vehicles of this class shall have when being drawn.
SUMOReal getImpatience(SUMOTime now) const
returns the impatience
std::vector< PState * > Pedestrians
virtual MSPersonControl & getPersonControl()
Returns the person control.
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
The edge is a normal street.
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
SUMOReal y() const
Returns the y-position.
A storage for options typed value containers)
Container for pedestrian state and individual position update function.
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
std::vector< Obstacle > Obstacles
SUMOReal getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
static const SUMOReal BLOCKER_LOOKAHEAD
SUMOReal xBack
maximal position on the current lane in backward direction
static const int BACKWARD
const PositionVector & getShape() const
Returns this lane's shape.
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Patch the time in a way that it is at least as high as the simulation begin time. ...
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
SUMOReal myRelY
the orthogonal shift on the current lane
static const SUMOReal MAX_WAIT_TOLERANCE
bool isCrossing() const
return whether this edge is a pedestrian crossing
SUMOReal myRelX
the advancement along the current lane
const MSJunction * getFromJunction() const
const MSEdgeVector & getSuccessors() const
Returns the following edges.
MovePedestrians * myCommand
the MovePedestrians command that is registered
SUMOReal getMinGap() const
return the minimum gap of the pedestrian
void push_back_noDoublePos(const Position &p)
static void DEBUG_PRINT(const Obstacles &obs)
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
std::vector< MSEdge * > MSEdgeVector
int myNumActivePedestrians
the total number of active pedestrians
SUMOReal speed
speed relative to lane direction (positive means in the same direction)
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
SUMOReal getMaxSpeed() const
accessors to be used by MSPModel
static void initWalkingAreaPaths(const MSNet *net)
MSPModel_Striping(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
Representation of a lane in the micro simulation.
ActiveLanes myActiveLanes
store of all lanes which have pedestrians on them
const MSLane * myLane
the current lane of this pedestrian
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
static const SUMOReal LATERAL_PENALTY
Obstacle(int dir)
create No-Obstacle
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move pedestrians forward on one lane
void extrapolate(const SUMOReal val, const bool onlyFirst=false)
static const Position INVALID
Position transformToVectorCoordinates(const Position &p, bool extend=false) const
return position p within the length-wise coordinate system defined by this position vector...
const MSJunction * getToJunction() const
static bool canTraverse(int dir, const ConstMSEdgeVector &route)
return whether the route may traversed with the given starting direction