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++) {
87 throw ProcessError(
"Found invalid logic position of a link (network error)");
89 sortedLinks.push_back(std::make_pair(*i, *j));
98 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
100 throw ProcessError(
"Found invalid logic position of a link (network error)");
106 for (
unsigned int c = 0; c < maxNo; ++c) {
107 if (foeLinks.test(c)) {
108 MSLink* foe = sortedLinks[c].second;
110 #ifdef HAVE_INTERNAL_LANES
112 assert(foe->getViaLane()->getLinkCont().size() == 1);
113 MSLink* foeExitLink = foe->getViaLane()->getLinkCont()[0];
115 if (foeExitLink->getViaLane() != 0) {
122 std::vector<MSLink*> foes;
123 for (
unsigned int c = 0; c < maxNo; ++c) {
124 if (internalFoes.test(c)) {
125 MSLink* foe = sortedLinks[c].second;
127 #ifdef HAVE_INTERNAL_LANES
128 MSLane* l = foe->getViaLane();
134 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
135 if ((*q)->getViaLane() != 0) {
144 #ifdef HAVE_INTERNAL_LANES
147 for (
unsigned int c = 0; c < sortedLinks.size(); ++c) {
148 if (sortedLinks[c].second->getLane() == 0) {
151 if (internalFoes.test(c)) {
153 if (foeLinks.test(c)) {
154 const std::vector<MSLane::IncomingLaneInfo>& l = myInternalLanes[li]->getIncomingLanes();
165 #ifdef HAVE_INTERNAL_LANES
169 assert((*j)->getViaLane()->getLinkCont().size() == 1);
170 MSLink* exitLink = (*j)->getViaLane()->getLinkCont()[0];
175 for (std::vector<MSLink*>::const_iterator k = foes.begin(); k != foes.end(); ++k) {
176 (*j)->addBlockedLink(*k);
177 (*k)->addBlockedLink(*j);
virtual bool getIsCont(unsigned int linkIndex) const
unsigned int getLogicSize() const
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.
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.
void setRequestInformation(unsigned int index, bool isCrossing, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes, MSLane *internalLaneBefore=0)
Sets the request information.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
std::map< const MSLink *, std::vector< MSLane * > > myLinkFoeInternalLanes
virtual bool isCrossing() const
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.