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));
650 for (
int i = 0; i < (int)pedestrians.size(); i++) {
651 PState*
const p = pedestrians[i];
655 pedestrians.erase(pedestrians.begin() + i);
676 sort(pedestrians.begin(), pedestrians.end(),
by_xpos_sorter(dir));
677 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
678 PState& p = *pedestrians[ii];
702 nextLanesObs, lane, nextLane, stripes,
745 p.
walk(currentObs, currentTime);
752 for (
int coll = 0; coll < ii; ++coll) {
753 PState& c = *pedestrians[coll];
760 +
"', lane='" + lane->
getID() +
"', time=" +
time2string(currentTime) +
".");
784 description(ped.myPerson->getID()) {
801 myRelX(stage->getDepartPos()),
805 myWaitingToEnter(true),
807 myWalkingAreaPath(0),
812 if (route.size() == 1) {
819 std::cout <<
" initialize dir for " <<
myPerson->
getID() <<
" forward=" << mayStartForward <<
" backward=" << mayStartBackward <<
"\n";
821 if (mayStartForward && mayStartBackward) {
825 if (crossingRoute.size() > 1) {
827 const MSEdge* nextEdge = crossingRoute[1];
833 std::cout <<
" crossingRoute=" <<
toString(crossingRoute) <<
"\n";
855 return myRelX - getLength();
857 return myRelX - (includeMinGap ? getMinGap() : 0.);
865 return myRelX + (includeMinGap ? getMinGap() : 0.);
867 return myRelX + getLength();
873 return myPerson->getVehicleType().getLength();
879 return myPerson->getVehicleType().getMinGap();
891 const int s = stripe(relY);
895 if (offset > threshold) {
897 }
else if (offset < -threshold) {
922 if (myStage->getNextRouteEdge() == 0) {
923 return myDir * (myStage->getArrivalPos() - myRelX) -
POSITION_EPS;
925 const SUMOReal length = myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length;
926 return myDir ==
FORWARD ? length - myRelX : myRelX;
933 const SUMOReal dist = distToLaneEnd();
934 if (myPerson->getID() ==
DEBUG1) {
935 std::cout <<
SIMTIME <<
" myRelX=" << myRelX <<
" dist=" << dist <<
"\n";
943 const int oldDir = myDir;
944 const MSLane* oldLane = myLane;
950 <<
" ped=" << myPerson->getID()
951 <<
" moveToNextLane old=" << oldLane->
getID()
952 <<
" new=" << (myLane == 0 ?
"NULL" : myLane->getID())
953 <<
" oldDir=" << oldDir
954 <<
" newDir=" << myDir
958 myRelX = myStage->getArrivalPos();
960 myStage->moveToNextEdge(myPerson, currentTime, normalLane ? 0 : &myLane->getEdge());
964 assert(myNLI.lane != oldLane);
966 std::cout <<
" nextLane=" << (myNLI.lane == 0 ?
"NULL" : myNLI.lane->getID()) <<
"\n";
968 if (myLane->getEdge().isWalkingArea()) {
971 assert(myWalkingAreaPath->from != 0);
972 assert(myWalkingAreaPath->to != 0);
973 assert(myWalkingAreaPath->shape.size() >= 2);
975 std::cout <<
" mWAPath shape=" << myWalkingAreaPath->shape <<
" length=" << myWalkingAreaPath->length <<
"\n";
980 myStage->moveToNextEdge(myPerson, currentTime, 0);
985 myWalkingAreaPath = 0;
987 throw ProcessError(
"Disconnected walk for person '" + myPerson->getID() +
"'.");
991 myWalkingAreaPath = 0;
995 const SUMOReal newLength = (myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length);
996 myRelX = newLength + dist;
1001 if (myDir != oldDir) {
1005 myRelY += 0.5 * (myLane->getWidth() - oldLane->
getWidth());
1016 const int stripes = (int)obs.size();
1017 const int sMax = stripes - 1;
1019 const SUMOReal vMax = myStage->getMaxSpeed();
1021 const int current = stripe();
1022 const int other = otherStripe();
1024 std::vector<SUMOReal> utility(stripes);
1026 for (
int i = 0; i < stripes; ++i) {
1030 std::vector<SUMOReal> distance(stripes);
1031 for (
int i = 0; i < stripes; ++i) {
1032 distance[i] = distanceTo(obs[i]);
1035 for (
int i = 0; i < stripes; ++i) {
1037 if (i == current && !myWaitingToEnter) {
1041 for (
int j = 0; j <= i; ++j) {
1046 for (
int j = i; j < stripes; ++j) {
1057 for (
int i = 0; i < reserved; ++i) {
1061 for (
int i = sMax; i > sMax - reserved; --i) {
1066 for (
int i = 0; i < stripes; ++i) {
1067 if (obs[i].speed < 0) {
1069 if (myDir ==
FORWARD && i > 0) {
1070 utility[i - 1] -= 0.5;
1071 }
else if (myDir ==
BACKWARD && i < sMax) {
1072 utility[i + 1] -= 0.5;
1080 std::cout <<
" util=" << utility[i] <<
" exp=" << expectedDist <<
"\n";
1082 if (expectedDist >= 0) {
1083 utility[i] += expectedDist;
1091 if (((myDir ==
FORWARD && current == sMax)
1092 || (myDir ==
BACKWARD && current == 0))
1093 && obs[current].speed * myDir < 0) {
1098 if (((myDir ==
BACKWARD && current == sMax)
1099 || (myDir ==
FORWARD && current == 0))
1100 && obs[current].speed * myDir < 0) {
1105 int chosen = current;
1106 for (
int i = 0; i < stripes; ++i) {
1107 if (utility[chosen] < utility[i]) {
1112 const int next = (chosen == current ? current : (chosen < current ? current - 1 : current + 1));
1113 const SUMOReal xDist =
MIN3(distance[current], distance[other], distance[next]);
1121 std::cout <<
" xSpeedPotential=" << xSpeed <<
"\n";
1129 if (myWaitingTime >
jamTime || myAmJammed) {
1134 +
"' is jammed on edge '" + myStage->getEdge()->getID()
1164 ySpeed = (yDist > 0 ?
1172 <<
" ped=" << myPerson->getID()
1173 <<
" edge=" << myStage->getEdge()->getID()
1177 <<
" pvx=" << mySpeed
1178 <<
" cur=" << current
1179 <<
" cho=" << chosen
1183 <<
" dawdle=" << dawdle
1187 <<
" vMax=" << myStage->getMaxSpeed()
1188 <<
" wTime=" << myStage->getWaitingTime(currentTime)
1189 <<
" jammed=" << myAmJammed
1190 <<
"\n distance=" <<
toString(distance)
1191 <<
"\n utility=" <<
toString(utility)
1199 myWaitingToEnter =
false;
1210 myPerson->getVehicleType().getImpatience()
1228 if (myWalkingAreaPath == 0) {
1231 return myWalkingAreaPath->shape.positionAtOffset(myRelX, lateral_offset);
1242 const PositionVector& shp = myWalkingAreaPath == 0 ? myLane->getShape() : myWalkingAreaPath->shape;
1253 return myWaitingTime;
1265 return myNLI.lane == 0 ? 0 : &myNLI.lane->getEdge();
1272 const SUMOReal maxX = getMaxX(includeMinGap);
1273 const SUMOReal minX = getMinX(includeMinGap);
1274 if ((obs.
xFwd >= maxX && obs.
xBack <= maxX) || (obs.
xFwd <= maxX && obs.
xFwd >= minX)) {
1287 for (
int i = 0; i < (int)into.size(); ++i) {
1289 std::cout <<
" i=" << i <<
" intoDist=" << distanceTo(into[i]) <<
" obs2Dist=" << distanceTo(obs2[i]) <<
"\n";
1291 if (distanceTo(obs2[i]) < distanceTo(into[i])) {
1306 std::set<MSPerson*> changedLane;
1311 for (ActiveLanes::const_iterator it_lane =
myModel->getActiveLanes().begin(); it_lane !=
myModel->getActiveLanes().end(); ++it_lane) {
1312 const MSLane* lane = it_lane->first;
1314 if (pedestrians.size() == 0) {
1319 for (
int ii = 0; ii < (int)pedestrians.size(); ++ii) {
1320 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
void registerJammed()
register a jammed transportable
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
reverse position vector
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
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, SUMOReal posLat=0, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
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.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
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
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
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)
insert in back a non double position
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
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)
extrapolate position vector
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