45 std::vector<MSLane*> incoming,
46 std::vector<MSLane*>
internal,
60 std::vector<MSLane*>::iterator i;
63 std::vector<std::pair<MSLane*, MSLink*> > sortedLinks;
67 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
68 if ((*j)->getLane()->getEdge().isWalkingArea() ||
69 ((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
72 sortedLinks.push_back(std::make_pair(*i, *j));
81 const MSLane* walkingAreaFoe =
nullptr;
82 for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
83 if ((*j)->getLane()->getEdge().isWalkingArea()) {
86 walkingAreaFoe = (*j)->getLane();
89 }
else if (((*i)->getEdge().isWalkingArea() && !(*j)->getLane()->getEdge().isCrossing())) {
99 for (
int c = 0; c < maxNo; ++c) {
100 if (linkResponse.test(c)) {
101 MSLink* foe = sortedLinks[c].second;
107 if (foeExitLink->getViaLane() !=
nullptr) {
113 std::vector<MSLink*> foes;
114 for (
int c = 0; c < maxNo; ++c) {
115 if (linkFoes.test(c)) {
116 MSLink* foe = sortedLinks[c].second;
124 for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
125 if ((*q)->getViaLane() !=
nullptr) {
135 for (
int c = 0; c < (int)sortedLinks.size(); ++c) {
136 if (sortedLinks[c].second->getLane() ==
nullptr) {
139 if (linkFoes.test(c)) {
141 if (linkResponse.test(c)) {
142 const std::vector<MSLane::IncomingLaneInfo>& l =
myInternalLanes[li]->getIncomingLanes();
143 if (l.size() == 1 && l[0].lane->getEdge().isInternal()) {
155 assert((*j)->getViaLane()->getLinkCont().size() == 1);
157 exitLink->setRequestInformation((
int)requestPos,
false,
false, std::vector<MSLink*>(),
159 for (
const auto& ili : exitLink->getLane()->getIncomingLanes()) {
160 if (ili.lane->getEdge().isWalkingArea()) {
161 exitLink->addWalkingAreaFoeExit(ili.lane);
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 !=
nullptr && 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 (when entering the junction)