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.sourceforge.net/
11 // Copyright (C) 2001-2012 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 "MSInternalLane.h"
35 #include <algorithm>
36 #include <cassert>
37 #include <cmath>
38 
39 #ifdef CHECK_MEMORY_LEAKS
40 #include <foreign/nvwa/debug_new.h>
41 #endif // CHECK_MEMORY_LEAKS
42 
43 
44 // ===========================================================================
45 // static member definitions
46 // ===========================================================================
47 std::bitset<64> MSNoLogicJunction::myDump((unsigned long long) 0xffffffff);
48 
49 
50 
51 // ===========================================================================
52 // method definitions
53 // ===========================================================================
55  const Position& position,
56  const PositionVector& shape,
57  std::vector<MSLane*> incoming
59  , std::vector<MSLane*> internal
60 #endif
61  )
62  : MSJunction(id, position, shape),
63  myIncomingLanes(incoming)
64 #ifdef HAVE_INTERNAL_LANES
65  , myInternalLanes(internal)
66 #endif
67 {
68 }
69 
70 
72 
73 
74 void
76  std::vector<MSLane*>::iterator i;
77  // inform links where they have to report approaching vehicles to
78  for (i = myIncomingLanes.begin(); i != myIncomingLanes.end(); ++i) {
79  const MSLinkCont& links = (*i)->getLinkCont();
80  for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
81  (*j)->setRequestInformation(0, 0, false, false, std::vector<MSLink*>(), std::vector<MSLane*>());
82  }
83  }
84 #ifdef HAVE_INTERNAL_LANES
85  // set information for the internal lanes
86  for (i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) {
87  // ... set information about participation
88  static_cast<MSInternalLane*>(*i)->setParentJunctionInformation(&myDump, 0);
89  }
90 #endif
91 }
92 
93 
94 
95 /****************************************************************************/
96