53 std::list<AGBus>::iterator it1 =
buses.begin();
54 std::list<AGBus>::iterator it2 =
revBuses.begin();
56 std::list<std::pair<int, std::string> > drivingBuses1, drivingBuses2;
59 if (it1->getDeparture() > it2->getDeparture()) {
60 if (drivingBuses2.size() == 0) {
61 drivingBuses2.push_front(make_pair(it2->getDeparture(),
createName()));
62 }
else if (drivingBuses2.front().first > it2->getDeparture()) {
63 drivingBuses2.push_front(make_pair(it2->getDeparture(),
createName()));
66 it2->setName(drivingBuses2.front().second);
67 drivingBuses2.pop_front();
69 drivingBuses1.push_back(make_pair(
getReady(it2->getDeparture()), it2->getName()));
72 if (drivingBuses1.size() == 0) {
73 drivingBuses1.push_front(make_pair(it1->getDeparture(),
createName()));
74 }
else if (drivingBuses1.front().first > it1->getDeparture()) {
75 drivingBuses1.push_front(make_pair(it1->getDeparture(),
createName()));
78 it1->setName(drivingBuses1.front().second);
79 drivingBuses1.pop_front();
81 drivingBuses2.push_back(make_pair(
getReady(it1->getDeparture()), it1->getName()));
85 if (it1 !=
buses.end()) {
86 if (drivingBuses1.size() == 0) {
88 }
else if (drivingBuses1.front().first > it1->getDeparture()) {
91 it1->setName(drivingBuses1.front().second);
92 drivingBuses1.pop_front();
97 if (drivingBuses2.size() == 0) {
99 }
else if (drivingBuses2.front().first > it2->getDeparture()) {
102 it2->setName(drivingBuses2.front().second);
103 drivingBuses2.pop_front();