44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
56 std::vector<MSLane*> incoming,
58 std::vector<MSLane*>
internal,
78 unsigned int requestPos = 0;
79 std::vector<MSLane*>::iterator i;
81 unsigned int maxNo = 0;
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 (
unsigned int c = 0; c < maxNo; ++c) {
113 if (foeLinks.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 (
unsigned int c = 0; c < maxNo; ++c) {
130 if (internalFoes.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 (
unsigned int c = 0; c < sortedLinks.size(); ++c) {
154 if (sortedLinks[c].second->getLane() == 0) {
157 if (internalFoes.test(c)) {
159 if (foeLinks.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);
virtual bool getIsCont(unsigned int linkIndex) const
unsigned int getLogicSize() const
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 const std::bitset< 64 > & getInternalFoesFor(unsigned 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.
virtual const MSLogicJunction::LinkFoes & getFoesFor(unsigned int linkIndex) const
Returns the foes of the given link.
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
std::bitset< 64 > LinkFoes
Container for link foes.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
#define HAVE_INTERNAL_LANES
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
The edge is an internal edge.
Representation of a lane in the micro simulation.