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
RORouteDef.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// Base class for a vehicle's route definition
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11
// Copyright (C) 2001-2013 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 RORouteDef_h
22
#define RORouteDef_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 <string>
35
#include <iostream>
36
#include <
utils/common/Named.h
>
37
#include "
ReferencedItem.h
"
38
#include <
utils/common/SUMOAbstractRouter.h
>
39
#include "
RORoute.h
"
40
41
42
// ===========================================================================
43
// class declarations
44
// ===========================================================================
45
class
ROEdge
;
46
class
OptionsCont
;
47
class
ROVehicle
;
48
class
OutputDevice
;
49
50
51
// ===========================================================================
52
// class definitions
53
// ===========================================================================
63
class
RORouteDef
:
public
ReferencedItem
,
public
Named
{
64
public
:
70
RORouteDef
(
const
std::string&
id
,
const
unsigned
int
lastUsed,
71
const
bool
tryRepair);
72
73
75
virtual
~RORouteDef
();
76
77
80
void
addLoadedAlternative
(
RORoute
* alternative);
81
83
void
addAlternativeDef
(
const
RORouteDef
* alternative);
84
87
RORoute
*
buildCurrentRoute
(
SUMOAbstractRouter<ROEdge, ROVehicle>
& router,
SUMOTime
begin,
88
const
ROVehicle
& veh)
const
;
89
92
void
preComputeCurrentRoute
(
SUMOAbstractRouter<ROEdge, ROVehicle>
& router,
SUMOTime
begin,
93
const
ROVehicle
& veh)
const
;
94
97
void
repairCurrentRoute
(
SUMOAbstractRouter<ROEdge, ROVehicle>
& router,
SUMOTime
begin,
98
const
ROVehicle
& veh)
const
;
99
103
void
addAlternative
(
SUMOAbstractRouter<ROEdge, ROVehicle>
& router,
104
const
ROVehicle
*
const
,
RORoute
* current,
SUMOTime
begin);
105
106
const
ROEdge
*
getDestination
()
const
;
107
108
const
RORoute
*
getFirstRoute
()
const
{
109
return
myAlternatives
.front();
110
}
111
120
OutputDevice
&
writeXMLDefinition
(
OutputDevice
& dev,
const
ROVehicle
*
const
veh,
121
bool
asAlternatives,
bool
withExitTimes)
const
;
122
131
RORouteDef
*
copyOrigDest
(
const
std::string&
id
)
const
;
132
141
RORouteDef
*
copy
(
const
std::string&
id
)
const
;
142
144
SUMOReal
getOverallProb
()
const
;
145
146
protected
:
148
mutable
RORoute
*
myPrecomputed
;
149
151
mutable
unsigned
int
myLastUsed
;
152
154
std::vector<RORoute*>
myAlternatives
;
155
157
mutable
bool
myNewRoute
;
158
159
const
bool
myTryRepair
;
160
161
private
:
163
struct
ComparatorProbability
{
164
bool
operator()
(
const
RORoute
*
const
a,
const
RORoute
*
const
b) {
165
return
a->
getProbability
() > b->
getProbability
();
166
}
167
};
168
169
private
:
171
RORouteDef
(
const
RORouteDef
& src);
172
174
RORouteDef
&
operator=
(
const
RORouteDef
& src);
175
176
};
177
178
179
#endif
180
181
/****************************************************************************/
182
home
delphi
sumo
src
router
RORouteDef.h
Generated by
1.8.2