bool MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch(SUMOTime step) { // switch to the next programm if the GSP is reached if (isPosAtGSP(step, *myFrom)) { // adapt program's state if (mySwitchSynchron) { adaptLogic(step); } else { switchToPos(step, *myTo, TIME2STEPS(getGSPValue(*myTo))); } // switch to destination program return true; } // do not switch, yet return false; }
bool MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch(SUMOTime step) { MSSimpleTrafficLightLogic *LogicFrom = (MSSimpleTrafficLightLogic*) myFrom; MSSimpleTrafficLightLogic *LogicTo = (MSSimpleTrafficLightLogic*) myTo; SUMOReal posTo = 0; ///switch to the next programm if the GSP is reached if (isPosAtGSP(step, LogicFrom)==true) { posTo = getGSPValue(myTo); if (mySwitchSynchron) { adaptLogic(step, posTo); } else { switchToPos(step, LogicTo, (unsigned int) posTo); } return true; } return false; }