/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MSJunction.cpp14/// @author Christian Roessel15/// @author Daniel Krajzewicz16/// @author Michael Behrisch17/// @date Wed, 12 Dez 200118///19// The base class for an intersection20/****************************************************************************/21#include <config.h>2223#include "MSVehicle.h"24#include "MSEdge.h"25#include "MSJunction.h"26272829303132// ===========================================================================33// debug constants34// ===========================================================================35//#define DEBUG_LINKLEADER36//#define DEBUG_COND (ego->isSelected())37//#define DEBUG_COND (true)38394041// ===========================================================================42// class declarations43// ===========================================================================44class MSLink;4546// ===========================================================================47// static member definitions48// ===========================================================================4950// ===========================================================================51// member method definition52// ===========================================================================53MSJunction::MSJunction(const std::string& id, SumoXMLNodeType type, const Position& position,54const PositionVector& shape, const std::string& name) :55Named(id),56myType(type),57myPosition(position),58myShape(shape),59myName(name) {60}616263MSJunction::~MSJunction() {}646566const Position&67MSJunction::getPosition(bool secondaryShape) const {68return secondaryShape ? myPosition2 : myPosition;69}707172void73MSJunction::postloadInit() {}747576int77MSJunction::getNrOfIncomingLanes() const {78int nr = 0;79for (const MSEdge* e : myIncoming) {80nr += (int)e->getLanes().size();81}82return nr;83}848586/****************************************************************************/878889