SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GUIInternalLane.cpp
Go to the documentation of this file.
1
/****************************************************************************/
9
// Lane within junctions, derived from the normal lane
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
#include <string>
34
#include <utility>
35
#include <
utils/common/MsgHandler.h
>
36
#include <
utils/geom/Position.h
>
37
#include <
microsim/MSLane.h
>
38
#include <
microsim/MSVehicleControl.h
>
39
#include <
microsim/MSVehicleTransfer.h
>
40
#include <
microsim/MSNet.h
>
41
#include "
GUINet.h
"
42
#include "
GUIVehicle.h
"
43
#include "
GUILaneWrapper.h
"
44
#include "
GUIInternalLane.h
"
45
46
#ifdef CHECK_MEMORY_LEAKS
47
#include <
foreign/nvwa/debug_new.h
>
48
#endif // CHECK_MEMORY_LEAKS
49
50
51
// ===========================================================================
52
// method definitions
53
// ===========================================================================
54
GUIInternalLane::GUIInternalLane
(
const
std::string&
id
,
55
SUMOReal
maxSpeed,
SUMOReal
length,
56
MSEdge
*
const
edge,
unsigned
int
numericalID,
57
const
PositionVector
& shape,
SUMOReal
width,
58
SVCPermissions
permissions) :
59
MSInternalLane
(id, maxSpeed, length, edge, numericalID, shape, width, permissions) {}
60
61
62
GUIInternalLane::~GUIInternalLane
() {
63
// just to quit cleanly on a failure
64
if
(
myLock
.
locked
()) {
65
myLock
.
unlock
();
66
}
67
}
68
69
70
// ------ Vehicle insertion ------
71
void
72
GUIInternalLane::incorporateVehicle
(
MSVehicle
* veh,
SUMOReal
pos,
SUMOReal
speed,
73
const
MSLane::VehCont::iterator& at,
74
MSMoveReminder::Notification
notification) {
75
AbstractMutex::ScopedLocker
locker(
myLock
);
76
MSInternalLane::incorporateVehicle
(veh, pos, speed, at, notification);
77
}
78
79
80
// ------ Access to vehicles ------
81
const
MSLane::VehCont
&
82
GUIInternalLane::getVehiclesSecure
()
const
{
83
myLock
.
lock
();
84
return
myVehicles
;
85
}
86
87
88
void
89
GUIInternalLane::releaseVehicles
()
const
{
90
myLock
.
unlock
();
91
}
92
93
94
bool
95
GUIInternalLane::planMovements
(
SUMOTime
t) {
96
AbstractMutex::ScopedLocker
locker(
myLock
);
97
return
MSInternalLane::planMovements
(t);
98
}
99
100
101
bool
102
GUIInternalLane::executeMovements
(
SUMOTime
t, std::vector<MSLane*>& into) {
103
AbstractMutex::ScopedLocker
locker(
myLock
);
104
return
MSInternalLane::executeMovements
(t, into);
105
}
106
107
108
MSVehicle
*
109
GUIInternalLane::removeVehicle
(
MSVehicle
* remVehicle) {
110
AbstractMutex::ScopedLocker
locker(
myLock
);
111
return
MSLane::removeVehicle
(remVehicle);
112
}
113
114
115
void
116
GUIInternalLane::swapAfterLaneChange
(
SUMOTime
t) {
117
AbstractMutex::ScopedLocker
locker(
myLock
);
118
MSLane::swapAfterLaneChange
(t);
119
}
120
121
122
bool
123
GUIInternalLane::integrateNewVehicle
(
SUMOTime
t) {
124
AbstractMutex::ScopedLocker
locker(
myLock
);
125
return
MSLane::integrateNewVehicle
(t);
126
}
127
128
129
GUILaneWrapper
*
130
GUIInternalLane::buildLaneWrapper
(
unsigned
int
index) {
131
return
new
GUILaneWrapper
(*
this
,
myShape
, index);
132
}
133
134
135
void
136
GUIInternalLane::detectCollisions
(
SUMOTime
timestep,
int
stage) {
137
AbstractMutex::ScopedLocker
locker(
myLock
);
138
MSLane::detectCollisions
(timestep, stage);
139
}
140
141
142
143
/****************************************************************************/
144
build
buildd
sumo-0.17.1~dfsg
src
guisim
GUIInternalLane.cpp
Generated on Sun Jun 16 2013 17:30:15 for SUMO - Simulation of Urban MObility by
1.8.3.1