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
MSDevice_BTsender.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// A BT sender
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11
// Copyright (C) 2013-2014 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
#ifndef MSDevice_BTsender_h
22
#define MSDevice_BTsender_h
23
24
25
// ===========================================================================
26
// included modules
27
// ===========================================================================
28
#ifdef _MSC_VER
29
#include <
windows_config.h
>
30
#else
31
#include <
config.h
>
32
#endif
33
34
#include <set>
35
#include <string>
36
#include "
MSDevice.h
"
37
#include <
utils/common/SUMOTime.h
>
38
#include <
utils/geom/Position.h
>
39
40
41
// ===========================================================================
42
// class declarations
43
// ===========================================================================
44
class
SUMOVehicle
;
45
46
47
// ===========================================================================
48
// class definitions
49
// ===========================================================================
56
class
MSDevice_BTsender
:
public
MSDevice
{
57
public
:
61
static
void
insertOptions
(
OptionsCont
& oc);
62
63
74
static
void
buildVehicleDevices
(
SUMOVehicle
& v, std::vector<MSDevice*>& into);
75
76
78
friend
class
MSDevice_BTreceiver
;
79
80
81
82
public
:
84
~MSDevice_BTsender
();
85
86
87
90
99
bool
notifyEnter
(
SUMOVehicle
& veh,
Notification
reason);
100
101
115
bool
notifyMove
(
SUMOVehicle
& veh,
SUMOReal
oldPos,
SUMOReal
newPos,
SUMOReal
newSpeed);
116
117
128
bool
notifyLeave
(
SUMOVehicle
& veh,
SUMOReal
lastPos,
Notification
reason);
130
131
132
136
class
VehicleState
{
137
public
:
146
VehicleState
(
SUMOReal
_time,
SUMOReal
_speed,
SUMOReal
_angle,
const
Position
& _position,
const
std::string& _laneID,
SUMOReal
_lanePos)
147
:
time
(_time),
speed
(_speed),
angle
(_angle),
position
(_position),
laneID
(_laneID),
lanePos
(_lanePos) {}
148
150
~VehicleState
() {}
151
153
SUMOReal
time
;
155
SUMOReal
speed
;
157
SUMOReal
angle
;
159
Position
position
;
161
std::string
laneID
;
163
SUMOReal
lanePos
;
164
165
};
166
167
168
172
class
VehicleInformation
:
public
Named
{
173
public
:
177
VehicleInformation
(
const
std::string&
id
) :
Named
(id),
amOnNet
(true),
haveArrived
(false) {}
178
180
~VehicleInformation
() {}
181
185
Boundary
getBoxBoundary
()
const
{
186
Boundary
ret;
187
for
(std::vector<VehicleState>::const_iterator i =
updates
.begin(); i !=
updates
.end(); ++i) {
188
ret.
add
((*i).position);
189
}
190
return
ret;
191
}
192
194
std::vector<VehicleState>
updates
;
195
197
bool
amOnNet
;
198
200
bool
haveArrived
;
201
202
};
203
204
205
206
private
:
212
MSDevice_BTsender
(
SUMOVehicle
& holder,
const
std::string&
id
);
213
214
215
216
protected
:
218
static
std::map<std::string, VehicleInformation*>
sVehicles
;
219
220
221
222
private
:
224
MSDevice_BTsender
(
const
MSDevice_BTsender
&);
225
227
MSDevice_BTsender
&
operator=
(
const
MSDevice_BTsender
&);
228
229
230
};
231
232
233
#endif
234
235
/****************************************************************************/
236
tmp
buildd
sumo-0.21.0+dfsg
src
microsim
devices
MSDevice_BTsender.h
Generated on Thu Nov 20 2014 19:49:55 for SUMO - Simulation of Urban MObility by
1.8.1.2