1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file MSJunction.cpp
11 /// @author Christian Roessel
12 /// @author Daniel Krajzewicz
13 /// @author Michael Behrisch
14 /// @date Wed, 12 Dez 2001
15 /// @version $Id$
16 ///
17 // The base class for an intersection
18 /****************************************************************************/
19
20
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25
26 #include "MSVehicle.h"
27 #include "MSEdge.h"
28 #include "MSJunction.h"
29
30
31
32
33
34
35 // ===========================================================================
36 // debug constants
37 // ===========================================================================
38 //#define DEBUG_LINKLEADER
39 //#define DEBUG_COND (ego->isSelected())
40 //#define DEBUG_COND (true)
41
42
43
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class MSLink;
48
49 // ===========================================================================
50 // static member definitions
51 // ===========================================================================
52
53 // ===========================================================================
54 // member method definition
55 // ===========================================================================
MSJunction(const std::string & id,SumoXMLNodeType type,const Position & position,const PositionVector & shape)56 MSJunction::MSJunction(const std::string& id, SumoXMLNodeType type, const Position& position,
57 const PositionVector& shape) :
58 Named(id),
59 myType(type),
60 myPosition(position),
61 myShape(shape) {
62 }
63
64
~MSJunction()65 MSJunction::~MSJunction() {}
66
67
68 const Position&
getPosition() const69 MSJunction::getPosition() const {
70 return myPosition;
71 }
72
73
74 void
postloadInit()75 MSJunction::postloadInit() {}
76
77
78 int
getNrOfIncomingLanes() const79 MSJunction::getNrOfIncomingLanes() const {
80 int nr = 0;
81 for (const MSEdge* e : myIncoming) {
82 nr += (int)e->getLanes().size();
83 }
84 return nr;
85 }
86
87 /****************************************************************************/
88
89