43 #ifdef CHECK_MEMORY_LEAKS 45 #endif // CHECK_MEMORY_LEAKS 51 #ifdef HAVE_INTERNAL_LANES 52 MSInternalJunction::MSInternalJunction(
const std::string&
id,
56 std::vector<MSLane*> incoming,
57 std::vector<MSLane*>
internal)
62 MSInternalJunction::~MSInternalJunction() {}
66 MSInternalJunction::postloadInit() {
67 if (myIncomingLanes.size() == 0) {
72 const MSLane* specialLane = myIncomingLanes[0];
80 const int ownLinkIndex = specialLane->
getIncomingLanes()[0].viaLink->getIndex();
84 for (std::vector<MSLane*>::iterator i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) {
86 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
87 if ((*q)->getViaLane() != 0) {
88 const int foeIndex = (*i)->getIncomingLanes()[0].viaLink->getIndex();
89 if (response.test(foeIndex)) {
93 myInternalLaneFoes.push_back(*i);
95 myInternalLaneFoes.push_back((*q)->getViaLane());
97 myInternalLaneFoes.push_back(*i);
102 for (std::vector<MSLane*>::const_iterator i = myIncomingLanes.begin() + 1; i != myIncomingLanes.end(); ++i) {
105 for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) {
106 MSLane* via = (*j)->getViaLane();
107 if (std::find(myInternalLanes.begin(), myInternalLanes.end(), via) == myInternalLanes.end()) {
110 myInternalLinkFoes.push_back(*j);
114 thisLink->setRequestInformation((
int)requestPos,
true,
false, myInternalLinkFoes, myInternalLaneFoes, thisLink->getViaLane()->getLogicalPredecessorLane());
115 assert(thisLink->getViaLane()->getLinkCont().size() == 1);
116 MSLink* exitLink = thisLink->getViaLane()->getLinkCont()[0];
118 myInternalLaneFoes, thisLink->getViaLane());
119 for (std::vector<MSLink*>::const_iterator k = myInternalLinkFoes.begin(); k != myInternalLinkFoes.end(); ++k) {
120 thisLink->addBlockedLink(*k);
121 (*k)->addBlockedLink(thisLink);
MSEdge & getEdge() const
Returns the lane's edge.
void setRequestInformation(int index, bool hasFoes, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes, MSLane *internalLaneBefore=0)
Sets the request information.
const MSJunctionLogic * getLogic() const
const std::string & getID() const
Returns the id.
A point in 2D or 3D with translation and scaling methods.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
A junction with right-of-way - rules.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.
Representation of a lane in the micro simulation.
const MSJunction * getToJunction() const