SUMO - Simulation of Urban MObility
NIVissimExtendedEdgePoint.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 // -------------------
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 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 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
42  int edgeid, const std::vector<int>& lanes, double position,
43  const std::vector<int>& assignedVehicles)
44  : myEdgeID(edgeid), myLanes(lanes), myPosition(position),
45  myAssignedVehicles(assignedVehicles) {}
46 
47 
49 
50 
51 int
53  return myEdgeID;
54 }
55 
56 
57 double
59  return myPosition;
60 }
61 
62 
65  return
67 }
68 
69 
70 const std::vector<int>&
72  return myLanes;
73 }
74 
75 
76 void
78  // check whether an "all" indicator is there
79  bool hadAll = false;
80  for (std::vector<int>::const_iterator i = myLanes.begin(); !hadAll && i != myLanes.end(); ++i) {
81  if ((*i) == -1) {
82  hadAll = true;
83  }
84  }
85  // no -> return
86  if (!hadAll) {
87  return;
88  }
89  // patch lane indices
90  myLanes.clear();
91  for (int i = 0; i < (int) edge->getNumLanes(); ++i) {
92  myLanes.push_back(i);
93  }
94 }
95 
96 
97 /****************************************************************************/
98 
static bool dictionary(int id, NIVissimAbstractEdge *e)
void recheckLanes(const NBEdge *const edge)
Resets lane numbers if all lanes shall be used.
The representation of a single edge during network building.
Definition: NBEdge.h:71
NIVissimExtendedEdgePoint(int edgeid, const std::vector< int > &lanes, double position, const std::vector< int > &assignedVehicles)
Constructor.
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:413
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
const std::vector< int > & getLanes() const