48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
63 : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
97 return getLanePosition(e->
getLanes()[0], at, offset);
124 myCurrentInternalEdge(0),
125 myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS),
127 myPedestrianState(0) {
132 if (walkingTime > 0) {
144 if (myCurrentInternalEdge != 0) {
145 return myCurrentInternalEdge;
154 return myRoute.front();
160 return myPedestrianState->getEdgePos(*
this, now);
166 return myPedestrianState->getPosition(*
this, now);
172 return myPedestrianState->getAngle(*
this, now);
178 return myPedestrianState->getWaitingTime(*
this, now);
184 return myPedestrianState->getSpeed(*
this);
192 myRouteStep = myRoute.begin();
193 if (myWalkingTime == 0) {
194 if (!person->
proceed(net, now)) {
202 if (myWalkingTime > 0) {
203 mySpeed = computeAverageSpeed();
207 ((
MSEdge*) *myRouteStep)->addPerson(person);
214 for (std::vector<const MSEdge*>::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) {
215 length += (*i)->getLength();
217 length -= myDepartPos;
218 length -= myRoute.back()->getLength() - myArrivalPos;
219 return length /
STEPS2TIME(myWalkingTime + 1);
232 if (myWalkingTime > 0) {
234 }
else if (mySpeed > 0) {
244 .
writeAttr(
"agent", p.
getID()).writeAttr(
"link", myRoute.front()->getID()).closeTag();
251 .
writeAttr(
"agent", p.
getID()).writeAttr(
"link", myRoute.back()->getID()).closeTag();
259 if (myRouteStep == myRoute.end() - 1) {
261 if (myDestinationBusStop != 0) {
262 myDestinationBusStop->addPerson(person);
270 if (nextInternal == 0) {
272 myCurrentInternalEdge = 0;
274 myCurrentInternalEdge = nextInternal;
287 MSBusStop* toBS,
const std::vector<std::string>& lines)
289 myVehicle(0), myDestinationBusStop(toBS) {}
297 if (myVehicle != 0) {
298 return myVehicle->getEdge();
300 return myWaitingEdge;
306 return myWaitingEdge;
312 if (myVehicle != 0) {
322 if (myVehicle != 0) {
324 return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtOffset(myVehicle->getPositionOnLane());
332 if (myVehicle != 0) {
340 return getEdgeAngle(myWaitingEdge, myWaitingPos);
348 myWaitingEdge = previousEdge;
350 myWaitingSince = now;
352 if (myVehicle != 0 && myVehicle->getParameter().departProcedure ==
DEPART_TRIGGERED) {
354 myVehicle->addPerson(person);
367 return myLines.count(line) > 0;
373 return myVehicle == 0;
385 return myVehicle == 0 ? 0 : myVehicle->getSpeed();
427 myWaitingDuration(duration),
428 myWaitingUntil(until),
441 return &myDestination;
447 return &myDestination;
459 return myWaitingUntil;
471 return getEdgeAngle(&myDestination, myStartPos) + 45;
479 myWaitingStart = now;
480 const SUMOTime until =
MAX3(now, now + myWaitingDuration, myWaitingUntil);
494 if (myWaitingDuration >= 0) {
497 if (myWaitingUntil >= 0) {
520 return now - myWaitingStart;
542 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
559 SUMOReal atPos = (*myStep)->getEdgePos(time);
561 (*myStep)->setArrived(time);
569 (*myStep)->proceed(net,
this, time, arrivedAt, atPos);
591 (*myStep)->setDeparted(now);
597 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
598 (*i)->tripInfoOutput(os);
605 MSPersonPlan::const_iterator i =
myPlan->begin();
609 for (; i !=
myPlan->end(); ++i) {
610 (*i)->routeOutput(os);
637 return (*myStep)->getSpeed();