44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
57 : myTLControl(tlcontrol), myTLLogic(tlLogic),
58 myAssumedNextSwitch(nextSwitch), myAmValid(true) {}
72 bool isActive = myTLControl.isActive(myTLLogic);
73 size_t step1 = myTLLogic->getCurrentPhaseIndex();
74 SUMOTime next = myTLLogic->trySwitch(isActive);
75 size_t step2 = myTLLogic->getCurrentPhaseIndex();
81 myTLLogic->setTrafficLightSignals(t);
86 myAssumedNextSwitch += next;
93 if (tlLogic == myTLLogic) {
95 myAssumedNextSwitch = -1;
104 const std::string& programID,
SUMOTime delay,
const std::map<std::string, std::string>& parameters) :
118 if (phases.size() > 1) {
120 for (
int i = 0; i < (
int)phases.size(); ++i) {
121 const int iNext = (i + 1) % phases.size();
122 const std::string& state1 = phases[i]->getState();
123 const std::string& state2 = phases[iNext]->getState();
124 assert(state1.size() == state2.size());
125 for (
int j = 0; j < (
int)
MIN2(state1.size(), state2.size()); ++j) {
129 for (LaneVector::const_iterator it =
myLanes[j].begin(); it !=
myLanes[j].end(); ++it) {
133 +
" when switching to phase " +
toString(iNext));
155 while (
myLinks.size() <= pos) {
161 while (
myLanes.size() <= pos) {
176 std::map<MSLink*, LinkState>
178 std::map<MSLink*, LinkState> ret;
179 for (LinkVectorVector::const_iterator i1 =
myLinks.begin(); i1 !=
myLinks.end(); ++i1) {
181 for (LinkVector::const_iterator i2 = l.begin(); i2 != l.end(); ++i2) {
182 ret[*i2] = (*i2)->getState();
194 for (
size_t i = 0; i <
myLinks.size(); i++) {
197 for (LinkVector::const_iterator j = currGroup.begin(); j != currGroup.end(); j++) {
198 (*j)->setTLState(ls, t);
207 for (LinkVectorVector::const_iterator i1 =
myLinks.begin(); i1 !=
myLinks.end(); ++i1) {
209 for (LinkVector::const_iterator i2 = l.begin(); i2 != l.end(); ++i2) {
210 assert(vals.find(*i2) != vals.end());
221 for (LinkVectorVector::const_iterator i1 =
myLinks.begin(); i1 !=
myLinks.end(); ++i1, ++index) {
223 for (LinkVector::const_iterator i2 = l.begin(); i2 != l.end(); ++i2) {