44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
56 std::vector<MSLane*> incoming,
58 std::vector<MSLane*>
internal,
79 std::vector<MSLane*>::iterator i;
82 std::vector<std::pair<MSLane*, MSLink*> > sortedLinks;
86 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
87 if ((*j)->getLane()->getEdge().isWalkingArea() ||
88 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
91 sortedLinks.push_back(std::make_pair(*i, *j));
100 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
101 if ((*j)->getLane()->getEdge().isWalkingArea() ||
102 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
112 for (
int c = 0; c < maxNo; ++c) {
113 if (linkResponse.test(c)) {
114 MSLink* foe = sortedLinks[c].second;
116 #ifdef HAVE_INTERNAL_LANES
118 assert(foe->getViaLane()->getLinkCont().size() == 1);
119 MSLink* foeExitLink = foe->getViaLane()->getLinkCont()[0];
121 if (foeExitLink->getViaLane() != 0) {
128 std::vector<MSLink*> foes;
129 for (
int c = 0; c < maxNo; ++c) {
130 if (linkFoes.test(c)) {
131 MSLink* foe = sortedLinks[c].second;
133 #ifdef HAVE_INTERNAL_LANES
134 MSLane* l = foe->getViaLane();
140 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
141 if ((*q)->getViaLane() != 0) {
150 #ifdef HAVE_INTERNAL_LANES
153 for (
int c = 0; c < (int)sortedLinks.size(); ++c) {
154 if (sortedLinks[c].second->getLane() == 0) {
157 if (linkFoes.test(c)) {
159 if (linkResponse.test(c)) {
160 const std::vector<MSLane::IncomingLaneInfo>& l = myInternalLanes[li]->getIncomingLanes();
171 #ifdef HAVE_INTERNAL_LANES
175 assert((*j)->getViaLane()->getLinkCont().size() == 1);
176 MSLink* exitLink = (*j)->getViaLane()->getLinkCont()[0];
181 for (std::vector<MSLink*>::const_iterator k = foes.begin(); k != foes.end(); ++k) {
182 (*j)->addBlockedLink(*k);
183 (*k)->addBlockedLink(*j);
MSRightOfWayJunction(const std::string &id, SumoXMLNodeType type, const Position &position, const PositionVector &shape, std::vector< MSLane * > incoming, MSJunctionLogic *logic)
Constructor.
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.
MSJunctionLogic * myLogic
virtual bool getIsCont(int linkIndex) const
void postloadInit()
initialises the junction after the whole net has been loaded
std::vector< MSLane * > myIncomingLanes
list of incoming lanes
virtual ~MSRightOfWayJunction()
Destructor.
const std::string & getID() const
Returns the id.
std::map< const MSLink *, std::vector< MSLink * > > myLinkFoeLinks
A point in 2D or 3D with translation and scaling methods.
virtual bool hasFoes() const
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
std::map< const MSLink *, std::vector< MSLane * > > myLinkFoeInternalLanes
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
#define HAVE_INTERNAL_LANES
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
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.
The edge is an internal edge.
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.
Representation of a lane in the micro simulation.