SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSNoLogicJunction.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 // -------------------
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "MSNoLogicJunction.h"
33 #include "MSLane.h"
34 #include <algorithm>
35 #include <cassert>
36 #include <cmath>
37 
38 #ifdef CHECK_MEMORY_LEAKS
39 #include <foreign/nvwa/debug_new.h>
40 #endif // CHECK_MEMORY_LEAKS
41 
42 
43 // ===========================================================================
44 // static member definitions
45 // ===========================================================================
46 
47 // ===========================================================================
48 // method definitions
49 // ===========================================================================
51  const Position& position,
52  const PositionVector& shape,
53  std::vector<MSLane*> incoming
55  , std::vector<MSLane*> internal
56 #endif
57  ):
58  MSJunction(id, position, shape),
59  myIncomingLanes(incoming)
60 #ifdef HAVE_INTERNAL_LANES
61  , myInternalLanes(internal)
62 #endif
63 {}
64 
65 
67 
68 
69 void
71  std::vector<MSLane*>::iterator i;
72  // inform links where they have to report approaching vehicles to
73  for (i = myIncomingLanes.begin(); i != myIncomingLanes.end(); ++i) {
74  const MSLinkCont& links = (*i)->getLinkCont();
75  for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
76  (*j)->setRequestInformation(0, 0, false, false, std::vector<MSLink*>(), std::vector<MSLane*>());
77  }
78  }
79 }
80 
81 
82 
83 /****************************************************************************/
84 
std::vector< MSLane * > myIncomingLanes
The base class for an intersection.
Definition: MSJunction.h:57
virtual ~MSNoLogicJunction()
Destructor.
MSNoLogicJunction(const std::string &id, const Position &position, const PositionVector &shape, std::vector< MSLane * > incoming)
Constructor.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
#define HAVE_INTERNAL_LANES
Definition: config.h:47