51 std::vector<MSLane*> incoming,
52 std::vector<MSLane*>
internal,
66 std::vector<MSLane*>::iterator i;
69 std::vector<std::pair<MSLane*, MSLink*> > sortedLinks;
73 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
74 if ((*j)->getLane()->getEdge().isWalkingArea() ||
75 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
78 sortedLinks.push_back(std::make_pair(*i, *j));
87 const MSLane* walkingAreaFoe = 0;
88 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
89 if ((*j)->getLane()->getEdge().isWalkingArea()) {
92 walkingAreaFoe = (*j)->getLane();
95 }
else if (((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
105 for (
int c = 0; c < maxNo; ++c) {
106 if (linkResponse.test(c)) {
107 MSLink* foe = sortedLinks[c].second;
113 if (foeExitLink->getViaLane() != 0) {
119 std::vector<MSLink*> foes;
120 for (
int c = 0; c < maxNo; ++c) {
121 if (linkFoes.test(c)) {
122 MSLink* foe = sortedLinks[c].second;
130 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
131 if ((*q)->getViaLane() != 0) {
141 for (
int c = 0; c < (int)sortedLinks.size(); ++c) {
142 if (sortedLinks[c].second->getLane() == 0) {
145 if (linkFoes.test(c)) {
147 if (linkResponse.test(c)) {
148 const std::vector<MSLane::IncomingLaneInfo>& l =
myInternalLanes[li]->getIncomingLanes();
149 if (l.size() == 1 && l[0].lane->getEdge().isInternal()) {
161 assert((*j)->getViaLane()->getLinkCont().size() == 1);
163 exitLink->setRequestInformation((
int)requestPos,
false,
false, std::vector<MSLink*>(),
172 for (std::vector<MSLink*>::const_iterator k = foes.begin(); k != foes.end(); ++k) {
173 (*j)->addBlockedLink(*k);
174 (*k)->addBlockedLink(*j);
178 if (walkingAreaFoe != 0 && links.size() > 1) {
179 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
180 if (!(*j)->getLane()->getEdge().isWalkingArea()) {
MSLane * getLane() const
Returns the connected lane.
MSJunctionLogic * myLogic
const std::string & getID() const
Returns the id.
void postloadInit()
initialises the junction after the whole net has been loaded
std::vector< MSLane * > myIncomingLanes
list of incoming lanes
virtual ~MSRightOfWayJunction()
Destructor.
virtual bool hasFoes() const
MSLane * getViaLane() const
Returns the following inner lane.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::map< const MSLink *, std::vector< MSLink * > > myLinkFoeLinks
A point in 2D or 3D with translation and scaling methods.
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
MSRightOfWayJunction(const std::string &id, SumoXMLNodeType type, const Position &position, const PositionVector &shape, std::vector< MSLane *> incoming, std::vector< MSLane *> internal, MSJunctionLogic *logic)
Constructor.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
std::map< const MSLink *, std::vector< MSLane * > > myLinkFoeInternalLanes
std::vector< MSLane * > myInternalLanes
list of internal lanes
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
virtual bool getIsCont(int linkIndex) const
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.
Representation of a lane in the micro simulation.
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.
void addWalkingAreaFoe(const MSLane *lane)
add walkingarea as foe