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
MSPerson.h
Go to the documentation of this file.
1
/****************************************************************************/
10
// The class for modelling person-movements
11
/****************************************************************************/
12
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14
/****************************************************************************/
15
//
16
// This file is part of SUMO.
17
// SUMO is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
/****************************************************************************/
23
#ifndef MSPerson_h
24
#define MSPerson_h
25
26
27
// ===========================================================================
28
// included modules
29
// ===========================================================================
30
#ifdef _MSC_VER
31
#include <
windows_config.h
>
32
#else
33
#include <
config.h
>
34
#endif
35
36
#include <string>
37
#include <vector>
38
#include <set>
39
40
41
// ===========================================================================
42
// class declarations
43
// ===========================================================================
44
class
MSNet
;
45
class
MSEdge
;
46
class
OutputDevice
;
47
class
SUMOVehicleParameter
;
48
49
typedef
std::vector<const MSEdge*>
MSEdgeVector
;
50
51
52
// ===========================================================================
53
// class definitions
54
// ===========================================================================
60
class
MSPerson
{
61
public
:
66
class
MSPersonStage
{
67
public
:
69
MSPersonStage
(
const
MSEdge
& destination);
70
72
virtual
~MSPersonStage
();
73
75
const
MSEdge
&
getDestination
()
const
;
76
78
virtual
void
proceed
(
MSNet
* net,
MSPerson
* person,
SUMOTime
now,
const
MSEdge
& previousEdge) = 0;
79
81
void
setDeparted
(
SUMOTime
now);
82
84
void
setArrived
(
SUMOTime
now);
85
87
virtual
bool
isWaitingFor
(
const
std::string& line)
const
;
88
94
virtual
void
tripInfoOutput
(
OutputDevice
& os)
const
= 0;
95
96
97
protected
:
99
const
MSEdge
&
myDestination
;
100
102
SUMOTime
myDeparted
;
103
105
SUMOTime
myArrived
;
106
107
private
:
109
MSPersonStage
(
const
MSPersonStage
&);
110
112
MSPersonStage
&
operator=
(
const
MSPersonStage
&);
113
114
};
115
121
class
MSPersonStage_Walking
:
public
MSPersonStage
{
122
public
:
124
MSPersonStage_Walking
(
MSEdgeVector
route,
SUMOTime
walkingTime,
SUMOReal
speed);
125
127
~MSPersonStage_Walking
();
128
130
virtual
void
proceed
(
MSNet
* net,
MSPerson
* person,
SUMOTime
now,
const
MSEdge
& previousEdge);
131
137
virtual
void
tripInfoOutput
(
OutputDevice
& os)
const
;
138
139
private
:
141
SUMOTime
myWalkingTime
;
142
143
private
:
145
MSPersonStage_Walking
(
const
MSPersonStage_Walking
&);
146
148
MSPersonStage_Walking
&
operator=
(
const
MSPersonStage_Walking
&);
149
150
};
151
156
class
MSPersonStage_Driving
:
public
MSPersonStage
{
157
public
:
159
MSPersonStage_Driving
(
const
MSEdge
& destination,
160
const
std::vector<std::string> &lines);
161
163
~MSPersonStage_Driving
();
164
166
virtual
void
proceed
(
MSNet
* net,
MSPerson
* person,
SUMOTime
now,
const
MSEdge
& previousEdge);
167
169
bool
isWaitingFor
(
const
std::string& line)
const
;
170
176
virtual
void
tripInfoOutput
(
OutputDevice
& os)
const
;
177
178
private
:
180
const
std::set<std::string>
myLines
;
181
182
private
:
184
MSPersonStage_Driving
(
const
MSPersonStage_Driving
&);
185
187
MSPersonStage_Driving
&
operator=
(
const
MSPersonStage_Driving
&);
188
189
};
190
194
class
MSPersonStage_Waiting
:
public
MSPersonStage
{
195
public
:
197
MSPersonStage_Waiting
(
const
MSEdge
& destination,
SUMOTime
duration,
SUMOTime
until);
198
200
~MSPersonStage_Waiting
();
201
203
virtual
void
proceed
(
MSNet
* net,
MSPerson
* person,
SUMOTime
now,
const
MSEdge
& previousEdge);
204
210
virtual
void
tripInfoOutput
(
OutputDevice
& os)
const
;
211
212
private
:
214
SUMOTime
myWaitingDuration
;
215
217
SUMOTime
myWaitingUntil
;
218
219
private
:
221
MSPersonStage_Waiting
(
const
MSPersonStage_Waiting
&);
222
224
MSPersonStage_Waiting
&
operator=
(
const
MSPersonStage_Waiting
&);
225
226
};
227
228
public
:
230
typedef
std::vector<MSPersonStage*>
MSPersonPlan
;
231
232
private
:
234
const
SUMOVehicleParameter
*
myParameter
;
235
237
MSPersonPlan
*
myPlan
;
238
240
MSPersonPlan::iterator
myStep
;
241
242
public
:
244
MSPerson
(
const
SUMOVehicleParameter
* pars,
MSPersonPlan
* plan);
245
247
~MSPerson
();
248
250
const
std::string&
getID
()
const
;
251
253
void
proceed
(
MSNet
* net,
SUMOTime
time);
254
256
SUMOTime
getDesiredDepart
()
const
;
257
259
void
setDeparted
(
SUMOTime
now);
260
262
const
MSEdge
&
getDestination
()
const
;
263
269
void
tripInfoOutput
(
OutputDevice
& os)
const
;
270
272
bool
isWaitingFor
(
const
std::string& line)
const
;
273
274
private
:
276
MSPerson
(
const
MSPerson
&);
277
279
MSPerson
&
operator=
(
const
MSPerson
&);
280
281
};
282
283
284
#endif
285
286
/****************************************************************************/
var
build
temp
tmp.znCyBrHNjL
4.0-0-0
sumo
sumo-0.15.0~dfsg
src
microsim
MSPerson.h
Generated on Mon Mar 24 2014 09:53:11 for SUMO - Simulation of Urban MObility by
1.8.1.2