SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIVissimExtendedEdgePoint.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 
33 #include <netbuild/NBEdge.h>
35 #include "NIVissimEdge.h"
36 
37 #ifdef CHECK_MEMORY_LEAKS
38 #include <foreign/nvwa/debug_new.h>
39 #endif // CHECK_MEMORY_LEAKS
40 
41 
42 // ===========================================================================
43 // method definitions
44 // ===========================================================================
46  int edgeid, const std::vector<int>& lanes, SUMOReal position,
47  const std::vector<int>& assignedVehicles)
48  : myEdgeID(edgeid), myLanes(lanes), myPosition(position),
49  myAssignedVehicles(assignedVehicles) {}
50 
51 
53 
54 
55 int
57  return myEdgeID;
58 }
59 
60 
63  return myPosition;
64 }
65 
66 
69  return
71 }
72 
73 
74 const std::vector<int>&
76  return myLanes;
77 }
78 
79 
80 void
82  // check whether an "all" indicator is there
83  bool hadAll = false;
84  for (std::vector<int>::const_iterator i = myLanes.begin(); !hadAll && i != myLanes.end(); ++i) {
85  if ((*i) == -1) {
86  hadAll = true;
87  }
88  }
89  // no -> return
90  if (!hadAll) {
91  return;
92  }
93  // patch lane indices
94  myLanes.clear();
95  for (int i = 0; i < (int) edge->getNumLanes(); ++i) {
96  myLanes.push_back(i);
97  }
98 }
99 
100 
101 /****************************************************************************/
102