47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
63 : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
121 myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS),
127 if (walkingTime > 0) {
129 for (std::vector<const MSEdge*>::const_iterator i = route.begin(); i != route.end(); ++i) {
130 length += (*i)->getLength();
150 return myRoute.front();
157 return myCurrentBeginPos + myCurrentLength / myCurrentDuration * off;
165 return getEdgePosition(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off,
SIDEWALK_OFFSET);
173 return getEdgeAngle(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off) + 90;
191 myRouteStep = myRoute.begin();
192 myLastEntryTime = now;
193 if (myWalkingTime == 0) {
194 if (!person->
proceed(net, now)) {
203 ((
MSEdge*) *myRouteStep)->addPerson(person);
205 ? computeWalkingTime(*myRouteStep, myDepartPos, myArrivalPos, myDestinationBusStop)
206 : computeWalkingTime(*myRouteStep, myDepartPos, -1, 0);
215 }
else if (toPos < 0) {
216 toPos = e->
getLanes()[0]->getLength();
221 myCurrentBeginPos = fromPos;
222 myCurrentLength = toPos - fromPos;
223 assert(myCurrentLength >= 0);
224 myCurrentDuration =
MAX2(myCurrentLength, (
SUMOReal)1.0) / mySpeed;
232 "\"").closeTag(
true);
240 "\" type=\"departure" <<
241 "\" agent=\"" << p.
getID() <<
242 "\" link=\"" << myRoute.front()->getID() <<
243 "\"").closeTag(
true);
251 "\" type=\"arrival" <<
252 "\" agent=\"" << p.
getID() <<
253 "\" link=\"" << myRoute.back()->getID() <<
254 "\"").closeTag(
true);
260 ((
MSEdge*) *myRouteStep)->removePerson(person);
261 if (myRouteStep == myRoute.end() - 1) {
263 if (myDestinationBusStop != 0) {
264 myDestinationBusStop->addPerson(person);
272 myRouteStep == myRoute.end() - 1
273 ? computeWalkingTime(*myRouteStep, 0, myArrivalPos, myDestinationBusStop)
274 : computeWalkingTime(*myRouteStep, 0, -1, 0);
275 ((
MSEdge*) *myRouteStep)->addPerson(person);
276 myLastEntryTime = currentTime;
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().positionAtLengthPosition(myVehicle->getPositionOnLane());
332 if (myVehicle != 0) {
340 return getEdgeAngle(myWaitingEdge, myWaitingPos);
348 myWaitingEdge = previousEdge;
351 if (myVehicle != 0 && myVehicle->getParameter().departProcedure ==
DEPART_TRIGGERED) {
353 myVehicle->addPerson(person);
366 return myLines.count(line) > 0;
372 return myVehicle == 0;
387 "\"").closeTag(
true);
395 "\" type=\"arrival" <<
396 "\" agent=\"" << p.
getID() <<
398 "\"").closeTag(
true);
406 "\" type=\"arrival" <<
407 "\" agent=\"" << p.
getID() <<
409 "\"").closeTag(
true);
419 myWaitingDuration(duration),
420 myWaitingUntil(until),
433 return &myDestination;
439 return &myDestination;
456 return getEdgeAngle(&myDestination, myStartPos) + 45;
464 const SUMOTime until =
MAX3(now, now + myWaitingDuration, myWaitingUntil);
473 "\"").closeTag(
true);
481 "\" type=\"actstart " << myActType <<
482 "\" agent=\"" << p.
getID() <<
484 "\"").closeTag(
true);
492 "\" type=\"actend " << myActType <<
493 "\" agent=\"" << p.
getID() <<
495 "\"").closeTag(
true);
508 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
525 SUMOReal atPos = (*myStep)->getEdgePos(time);
527 (*myStep)->setArrived(time);
533 Position pos = (*myStep)->getPosition(time);
536 (*myStep)->proceed(net,
this, time, arrivedAt, atPos);
558 (*myStep)->setDeparted(now);
564 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
565 (*i)->tripInfoOutput(os);