41 #ifdef CHECK_MEMORY_LEAKS
43 #endif // CHECK_MEMORY_LEAKS
49 #ifdef HAVE_INTERNAL_LANES
50 MSInternalJunction::MSInternalJunction(
const std::string&
id,
53 std::vector<MSLane*> incoming,
54 std::vector<MSLane*>
internal)
59 MSInternalJunction::~MSInternalJunction() {}
63 MSInternalJunction::postloadInit() {
64 if (myIncomingLanes.size() == 0) {
65 throw ProcessError(
"Internal junction " + getID() +
" has no incoming lanes");
69 assert(myIncomingLanes[0]->getLinkCont().size() == 1);
70 MSLink* thisLink = myIncomingLanes[0]->getLinkCont()[0];
72 unsigned int requestPos = 0;
73 for (std::vector<MSLane*>::iterator i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) {
75 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
76 if ((*q)->getViaLane() != 0) {
77 myInternalLaneFoes.push_back((*q)->getViaLane());
79 myInternalLaneFoes.push_back(*i);
84 for (std::vector<MSLane*>::const_iterator i = myIncomingLanes.begin() + 1; i != myIncomingLanes.end(); ++i) {
87 for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) {
88 MSLane* via = (*j)->getViaLane();
89 if (std::find(myInternalLanes.begin(), myInternalLanes.end(), via) == myInternalLanes.end()) {
92 myInternalLinkFoes.push_back(*j);
95 thisLink->
setRequestInformation(requestPos, requestPos,
true,
false, myInternalLinkFoes, myInternalLaneFoes);
96 assert(thisLink->getViaLane()->getLinkCont().size() == 1);
97 MSLink* exitLink = thisLink->getViaLane()->getLinkCont()[0];
99 myInternalLaneFoes, thisLink->getViaLane());
100 for (std::vector<MSLink*>::const_iterator k = myInternalLinkFoes.begin(); k != myInternalLinkFoes.end(); ++k) {
102 (*k)->addBlockedLink(thisLink);
void addBlockedLink(MSLink *link)
A point in 2D or 3D with translation and scaling methods.
void setRequestInformation(unsigned int requestIdx, unsigned int respondIdx, bool isCrossing, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes, MSLane *internalLaneBefore=0)
Sets the request information.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
Representation of a lane in the micro simulation.