44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
55 std::vector<MSLane*> incoming,
57 std::vector<MSLane*>
internal,
77 unsigned int requestPos = 0;
78 std::vector<MSLane*>::iterator i;
80 unsigned int maxNo = 0;
81 std::vector<std::pair<MSLane*, MSLink*> > sortedLinks;
85 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
86 if ((*j)->getLane()->getEdge().isWalkingArea() ||
87 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
90 sortedLinks.push_back(std::make_pair(*i, *j));
99 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
100 if ((*j)->getLane()->getEdge().isWalkingArea() ||
101 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
111 for (
unsigned int c = 0; c < maxNo; ++c) {
112 if (foeLinks.test(c)) {
113 MSLink* foe = sortedLinks[c].second;
115 #ifdef HAVE_INTERNAL_LANES
117 assert(foe->getViaLane()->getLinkCont().size() == 1);
118 MSLink* foeExitLink = foe->getViaLane()->getLinkCont()[0];
120 if (foeExitLink->getViaLane() != 0) {
127 std::vector<MSLink*> foes;
128 for (
unsigned int c = 0; c < maxNo; ++c) {
129 if (internalFoes.test(c)) {
130 MSLink* foe = sortedLinks[c].second;
132 #ifdef HAVE_INTERNAL_LANES
133 MSLane* l = foe->getViaLane();
139 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
140 if ((*q)->getViaLane() != 0) {
149 #ifdef HAVE_INTERNAL_LANES
152 for (
unsigned int c = 0; c < sortedLinks.size(); ++c) {
153 if (sortedLinks[c].second->getLane() == 0) {
156 if (internalFoes.test(c)) {
158 if (foeLinks.test(c)) {
159 const std::vector<MSLane::IncomingLaneInfo>& l = myInternalLanes[li]->getIncomingLanes();
170 #ifdef HAVE_INTERNAL_LANES
174 assert((*j)->getViaLane()->getLinkCont().size() == 1);
175 MSLink* exitLink = (*j)->getViaLane()->getLinkCont()[0];
180 for (std::vector<MSLink*>::const_iterator k = foes.begin(); k != foes.end(); ++k) {
181 (*j)->addBlockedLink(*k);
182 (*k)->addBlockedLink(*j);
virtual bool getIsCont(unsigned int linkIndex) const
unsigned int getLogicSize() const
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
MSRightOfWayJunction(const std::string &id, const Position &position, const PositionVector &shape, std::vector< MSLane * > incoming, MSJunctionLogic *logic)
Constructor.
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.
#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.