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
MSBusStop.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// A lane area vehicles can halt at
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11
// Copyright (C) 2005-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 MSBusStop_h
22
#define MSBusStop_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 <vector>
35
#include <algorithm>
36
#include <map>
37
#include <string>
38
#include <
utils/common/Named.h
>
39
40
41
// ===========================================================================
42
// class declarations
43
// ===========================================================================
44
class
MSLane
;
45
class
SUMOVehicle
;
46
class
MSPerson
;
47
48
49
// ===========================================================================
50
// class definitions
51
// ===========================================================================
64
class
MSBusStop
:
public
Named
{
65
public
:
75
MSBusStop
(
const
std::string&
id
,
76
const
std::vector<std::string>& lines,
MSLane
& lane,
77
SUMOReal
begPos,
SUMOReal
endPos);
78
79
81
virtual
~MSBusStop
();
82
83
88
const
MSLane
&
getLane
()
const
;
89
90
95
SUMOReal
getBeginLanePosition
()
const
;
96
97
102
SUMOReal
getEndLanePosition
()
const
;
103
104
116
void
enter
(
SUMOVehicle
* what,
SUMOReal
beg,
SUMOReal
end);
117
118
128
void
leaveFrom
(
SUMOVehicle
* what);
129
130
135
SUMOReal
getLastFreePos
(
const
SUMOVehicle
& forVehicle)
const
;
136
137
140
unsigned
int
getPersonNumber
()
const
{
141
return
static_cast<
unsigned
int
>
(
myWaitingPersons
.size());
142
}
143
144
void
addPerson
(
MSPerson
* p) {
145
myWaitingPersons
.push_back(p);
146
}
147
148
void
removePerson
(
MSPerson
* p) {
149
std::vector<MSPerson*>::iterator i = std::find(
myWaitingPersons
.begin(),
myWaitingPersons
.end(), p);
150
if
(i !=
myWaitingPersons
.end()) {
151
myWaitingPersons
.erase(i);
152
}
153
}
154
155
protected
:
162
void
computeLastFreePos
();
163
164
165
protected
:
167
std::vector<std::string>
myLines
;
168
170
std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> >
myEndPositions
;
171
173
MSLane
&
myLane
;
174
176
SUMOReal
myBegPos
;
177
179
SUMOReal
myEndPos
;
180
182
SUMOReal
myLastFreePos
;
183
185
std::vector<MSPerson*>
myWaitingPersons
;
186
187
188
private
:
190
MSBusStop
(
const
MSBusStop
&);
191
193
MSBusStop
&
operator=
(
const
MSBusStop
&);
194
195
196
};
197
198
199
#endif
200
201
/****************************************************************************/
202
tmp
buildd
sumo-0.21.0+dfsg
src
microsim
trigger
MSBusStop.h
Generated on Thu Nov 20 2014 19:49:54 for SUMO - Simulation of Urban MObility by
1.8.1.2