47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
63 : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
122 myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS),
128 if (walkingTime > 0) {
130 for (std::vector<const MSEdge*>::const_iterator i = route.begin(); i != route.end(); ++i) {
131 length += (*i)->getLength();
151 return myRoute.front();
158 return myCurrentBeginPos + myCurrentLength / myCurrentDuration * off;
166 return getEdgePosition(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off,
SIDEWALK_OFFSET);
174 return getEdgeAngle(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off) + 90;
182 myRouteStep = myRoute.begin();
183 myLastEntryTime = now;
184 if (myWalkingTime == 0) {
185 if (!person->
proceed(net, now)) {
194 ((
MSEdge*) *myRouteStep)->addPerson(person);
196 ? computeWalkingTime(*myRouteStep, myDepartPos, myArrivalPos, myDestinationBusStop)
197 : computeWalkingTime(*myRouteStep, myDepartPos, -1, 0);
206 }
else if (toPos < 0) {
207 toPos = e->
getLanes()[0]->getLength();
212 myCurrentBeginPos = fromPos;
213 myCurrentLength = toPos - fromPos;
214 assert(myCurrentLength >= 0);
215 myCurrentDuration =
MAX2(myCurrentLength, (
SUMOReal)1.0) / mySpeed;
228 if (myWalkingTime > 0) {
230 }
else if (mySpeed > 0) {
240 .
writeAttr(
"agent", p.
getID()).writeAttr(
"link", myRoute.front()->getID()).closeTag();
247 .
writeAttr(
"agent", p.
getID()).writeAttr(
"link", myRoute.back()->getID()).closeTag();
253 ((
MSEdge*) *myRouteStep)->removePerson(person);
254 if (myRouteStep == myRoute.end() - 1) {
256 if (myDestinationBusStop != 0) {
257 myDestinationBusStop->addPerson(person);
265 myRouteStep == myRoute.end() - 1
266 ? computeWalkingTime(*myRouteStep, 0, myArrivalPos, myDestinationBusStop)
267 : computeWalkingTime(*myRouteStep, 0, -1, 0);
268 ((
MSEdge*) *myRouteStep)->addPerson(person);
269 myLastEntryTime = currentTime;
280 MSBusStop* toBS,
const std::vector<std::string>& lines)
282 myVehicle(0), myDestinationBusStop(toBS) {}
290 if (myVehicle != 0) {
291 return myVehicle->getEdge();
293 return myWaitingEdge;
299 return myWaitingEdge;
305 if (myVehicle != 0) {
315 if (myVehicle != 0) {
317 return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtOffset(myVehicle->getPositionOnLane());
325 if (myVehicle != 0) {
333 return getEdgeAngle(myWaitingEdge, myWaitingPos);
341 myWaitingEdge = previousEdge;
343 myWaitingSince = now;
345 if (myVehicle != 0 && myVehicle->getParameter().departProcedure ==
DEPART_TRIGGERED) {
347 myVehicle->addPerson(person);
360 return myLines.count(line) > 0;
366 return myVehicle == 0;
414 myWaitingDuration(duration),
415 myWaitingUntil(until),
428 return &myDestination;
434 return &myDestination;
446 return myWaitingUntil;
458 return getEdgeAngle(&myDestination, myStartPos) + 45;
466 const SUMOTime until =
MAX3(now, now + myWaitingDuration, myWaitingUntil);
480 if (myWaitingDuration >= 0) {
483 if (myWaitingUntil >= 0) {
515 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
532 SUMOReal atPos = (*myStep)->getEdgePos(time);
534 (*myStep)->setArrived(time);
540 Position pos = (*myStep)->getPosition(time);
543 (*myStep)->proceed(net,
this, time, arrivedAt, atPos);
565 (*myStep)->setDeparted(now);
571 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
572 (*i)->tripInfoOutput(os);
579 MSPersonPlan::const_iterator i =
myPlan->begin();
583 for (; i !=
myPlan->end(); ++i) {
584 (*i)->routeOutput(os);