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;
181 myRouteStep = myRoute.begin();
182 myLastEntryTime = now;
183 if (myWalkingTime == 0) {
184 if (!person->
proceed(net, now)) {
193 ((
MSEdge*) *myRouteStep)->addPerson(person);
195 ? computeWalkingTime(*myRouteStep, myDepartPos, myArrivalPos, myDestinationBusStop)
196 : computeWalkingTime(*myRouteStep, myDepartPos, -1, 0);
205 }
else if (toPos < 0) {
206 toPos = e->
getLanes()[0]->getLength();
211 myCurrentBeginPos = fromPos;
212 myCurrentLength = toPos - fromPos;
213 assert(myCurrentLength >= 0);
214 myCurrentDuration =
MAX2(myCurrentLength, (
SUMOReal)1.0) / mySpeed;
229 if (myWalkingTime > 0) {
231 }
else if (mySpeed > 0) {
242 "\" type=\"departure" <<
243 "\" agent=\"" << p.
getID() <<
244 "\" link=\"" << myRoute.front()->getID() <<
253 "\" type=\"arrival" <<
254 "\" agent=\"" << p.
getID() <<
255 "\" link=\"" << myRoute.back()->getID() <<
262 ((
MSEdge*) *myRouteStep)->removePerson(person);
263 if (myRouteStep == myRoute.end() - 1) {
265 if (myDestinationBusStop != 0) {
266 myDestinationBusStop->addPerson(person);
274 myRouteStep == myRoute.end() - 1
275 ? computeWalkingTime(*myRouteStep, 0, myArrivalPos, myDestinationBusStop)
276 : computeWalkingTime(*myRouteStep, 0, -1, 0);
277 ((
MSEdge*) *myRouteStep)->addPerson(person);
278 myLastEntryTime = currentTime;
289 MSBusStop* toBS,
const std::vector<std::string>& lines)
291 myVehicle(0), myDestinationBusStop(toBS) {}
299 if (myVehicle != 0) {
300 return myVehicle->getEdge();
302 return myWaitingEdge;
308 return myWaitingEdge;
314 if (myVehicle != 0) {
324 if (myVehicle != 0) {
326 return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtOffset(myVehicle->getPositionOnLane());
334 if (myVehicle != 0) {
342 return getEdgeAngle(myWaitingEdge, myWaitingPos);
350 myWaitingEdge = previousEdge;
352 myWaitingSince = now;
354 if (myVehicle != 0 && myVehicle->getParameter().departProcedure ==
DEPART_TRIGGERED) {
356 myVehicle->addPerson(person);
369 return myLines.count(line) > 0;
375 return myVehicle == 0;
411 "\" type=\"arrival" <<
412 "\" agent=\"" << p.
getID() <<
422 "\" type=\"arrival" <<
423 "\" agent=\"" << p.
getID() <<
435 myWaitingDuration(duration),
436 myWaitingUntil(until),
449 return &myDestination;
455 return &myDestination;
467 return myWaitingUntil;
479 return getEdgeAngle(&myDestination, myStartPos) + 45;
487 const SUMOTime until =
MAX3(now, now + myWaitingDuration, myWaitingUntil);
503 if (myWaitingDuration >= 0) {
506 if (myWaitingUntil >= 0) {
517 "\" type=\"actstart " << myActType <<
518 "\" agent=\"" << p.
getID() <<
528 "\" type=\"actend " << myActType <<
529 "\" agent=\"" << p.
getID() <<
544 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
561 SUMOReal atPos = (*myStep)->getEdgePos(time);
563 (*myStep)->setArrived(time);
569 Position pos = (*myStep)->getPosition(time);
572 (*myStep)->proceed(net,
this, time, arrivedAt, atPos);
594 (*myStep)->setDeparted(now);
600 for (MSPersonPlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
601 (*i)->tripInfoOutput(os);
608 MSPersonPlan::const_iterator i =
myPlan->begin();
612 for (; i !=
myPlan->end(); ++i) {
613 (*i)->routeOutput(os);