58 #ifdef CHECK_MEMORY_LEAKS
60 #endif // CHECK_MEMORY_LEAKS
73 myDetectorBuilder(db),
76 myNetIsLoaded(false) {
90 const std::string& key,
94 const std::vector<MSLane*>& incomingLanes,
96 #ifdef HAVE_INTERNAL_LANES
97 myActiveInternalLanes = internalLanes;
101 myActiveIncomingLanes = incomingLanes;
105 myPosition.set(x, y);
113 throw ProcessError(
"Information about the number of nodes was missing.");
129 #ifdef HAVE_INTERNAL_LANES
131 junction = buildInternalJunction();
136 throw InvalidArgument(
"False junction logic type.");
140 throw InvalidArgument(
"Another junction with the id '" +
myActiveID +
"' exists.");
158 , myActiveInternalLanes
170 myActiveInternalLanes,
176 #ifdef HAVE_INTERNAL_LANES
178 NLJunctionControlBuilder::buildInternalJunction() {
181 myActiveInternalLanes);
190 throw InvalidArgument(
"Missing junction logic '" +
myActiveID +
"'.");
198 return getTLLogicControlToUse().get(
id);
206 throw InvalidArgument(
"The off program for TLS '" +
myActiveKey +
"' has phases.");
226 unsigned int step = 0;
228 MSSimpleTrafficLightLogic::Phases::const_iterator i =
myActivePhases.begin();
229 while (offset >= (*i)->duration) {
231 offset -= (*i)->duration;
294 const std::string& response,
295 const std::string& foes,
297 if (myCurrentHasError) {
303 myCurrentHasError =
true;
304 throw InvalidArgument(
"Junction logic '" + myActiveKey +
"' is larger than allowed; recheck the network.");
306 if (myRequestSize == NO_REQUEST_SIZE) {
308 myRequestSize = (
int)response.size();
310 if (static_cast<int>(response.size()) != myRequestSize) {
311 myCurrentHasError =
true;
313 " in Junction logic '" + myActiveKey +
"' (expected " +
toString(myRequestSize) +
")");
315 if (static_cast<int>(foes.size()) != myRequestSize) {
316 myCurrentHasError =
true;
318 " in Junction logic '" + myActiveKey +
"' (expected " +
toString(myRequestSize) +
")");
321 assert(myActiveLogic.size() == (size_t) request);
322 assert(myActiveFoes.size() == (size_t) request);
324 myActiveLogic.push_back(std::bitset<64>(response));
326 myActiveFoes.push_back(std::bitset<64>(foes));
328 myActiveConts.set(request, cont);
330 myRequestItemNumber++;
350 int minDuration,
int maxDuration) {
369 throw InvalidArgument(
"The description for the junction logic '" +
myActiveKey +
"' is malicious.");
372 throw InvalidArgument(
"Junction logic '" +
myActiveKey +
"' was defined twice.");
385 throw ProcessError(
"Traffic lights could not be built.");
395 const std::string& value) {