Eclipse SUMO - Simulation of Urban MObility
NIVissimExtendedEdgePoint.cpp
Go to the documentation of this file.
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
/****************************************************************************/
16
// -------------------
17
/****************************************************************************/
18
19
20
// ===========================================================================
21
// included modules
22
// ===========================================================================
23
#include <
config.h
>
24
25
#include <
utils/common/VectorHelper.h
>
26
#include <
netbuild/NBEdge.h
>
27
#include "
NIVissimExtendedEdgePoint.h
"
28
#include "
NIVissimEdge.h
"
29
30
31
// ===========================================================================
32
// method definitions
33
// ===========================================================================
34
NIVissimExtendedEdgePoint::NIVissimExtendedEdgePoint
(
35
int
edgeid,
const
std::vector<int>& lanes,
double
position,
36
const
std::vector<int>& assignedVehicles)
37
: myEdgeID(edgeid), myLanes(lanes), myPosition(position),
38
myAssignedVehicles(assignedVehicles) {}
39
40
41
NIVissimExtendedEdgePoint::~NIVissimExtendedEdgePoint
() {}
42
43
44
int
45
NIVissimExtendedEdgePoint::getEdgeID
()
const
{
46
return
myEdgeID
;
47
}
48
49
50
double
51
NIVissimExtendedEdgePoint::getPosition
()
const
{
52
return
myPosition
;
53
}
54
55
56
Position
57
NIVissimExtendedEdgePoint::getGeomPosition
()
const
{
58
return
59
NIVissimAbstractEdge::dictionary
(
myEdgeID
)->getGeomPosition(
myPosition
);
60
}
61
62
63
const
std::vector<int>&
64
NIVissimExtendedEdgePoint::getLanes
()
const
{
65
return
myLanes
;
66
}
67
68
69
void
70
NIVissimExtendedEdgePoint::recheckLanes
(
const
NBEdge
*
const
edge) {
71
// check whether an "all" indicator is there
72
bool
hadAll =
false
;
73
for
(std::vector<int>::const_iterator i =
myLanes
.begin(); !hadAll && i !=
myLanes
.end(); ++i) {
74
if
((*i) == -1) {
75
hadAll =
true
;
76
}
77
}
78
// no -> return
79
if
(!hadAll) {
80
return
;
81
}
82
// patch lane indices
83
myLanes
.clear();
84
for
(
int
i = 0; i < (int) edge->
getNumLanes
(); ++i) {
85
myLanes
.push_back(i);
86
}
87
}
88
89
90
/****************************************************************************/
91
NIVissimEdge.h
NIVissimExtendedEdgePoint::NIVissimExtendedEdgePoint
NIVissimExtendedEdgePoint(int edgeid, const std::vector< int > &lanes, double position, const std::vector< int > &assignedVehicles)
Constructor.
Definition:
NIVissimExtendedEdgePoint.cpp:34
NIVissimExtendedEdgePoint::getLanes
const std::vector< int > & getLanes() const
Definition:
NIVissimExtendedEdgePoint.cpp:64
NIVissimExtendedEdgePoint::myLanes
std::vector< int > myLanes
Definition:
NIVissimExtendedEdgePoint.h:71
NIVissimExtendedEdgePoint::getEdgeID
int getEdgeID() const
Definition:
NIVissimExtendedEdgePoint.cpp:45
NBEdge
The representation of a single edge during network building.
Definition:
NBEdge.h:86
VectorHelper.h
NIVissimExtendedEdgePoint::~NIVissimExtendedEdgePoint
~NIVissimExtendedEdgePoint()
Definition:
NIVissimExtendedEdgePoint.cpp:41
NBEdge::getNumLanes
int getNumLanes() const
Returns the number of lanes.
Definition:
NBEdge.h:465
NIVissimExtendedEdgePoint::myPosition
double myPosition
Definition:
NIVissimExtendedEdgePoint.h:72
Position
A point in 2D or 3D with translation and scaling methods.
Definition:
Position.h:39
NIVissimAbstractEdge::dictionary
static bool dictionary(int id, NIVissimAbstractEdge *e)
Definition:
NIVissimAbstractEdge.cpp:59
NIVissimExtendedEdgePoint::recheckLanes
void recheckLanes(const NBEdge *const edge)
Resets lane numbers if all lanes shall be used.
Definition:
NIVissimExtendedEdgePoint.cpp:70
NIVissimExtendedEdgePoint.h
NIVissimExtendedEdgePoint::getGeomPosition
Position getGeomPosition() const
Definition:
NIVissimExtendedEdgePoint.cpp:57
config.h
NIVissimExtendedEdgePoint::myEdgeID
int myEdgeID
Definition:
NIVissimExtendedEdgePoint.h:70
NIVissimExtendedEdgePoint::getPosition
double getPosition() const
Definition:
NIVissimExtendedEdgePoint.cpp:51
NBEdge.h
src
netimport
vissim
tempstructs
NIVissimExtendedEdgePoint.cpp
Generated on Wed Jan 15 2020 15:04:13 for Eclipse SUMO - Simulation of Urban MObility by
1.8.16