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.sourceforge.net/
11
// Copyright (C) 2001-2012 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
116
OutputDevice
&
writeXMLDefinition
(
OutputDevice
& dev,
const
ROVehicle
*
const
veh,
117
bool
asAlternatives,
bool
withExitTimes)
const
;
118
127
RORouteDef
*
copyOrigDest
(
const
std::string&
id
)
const
;
128
137
RORouteDef
*
copy
(
const
std::string&
id
)
const
;
138
140
SUMOReal
getOverallProb
()
const
;
141
142
protected
:
144
mutable
RORoute
*
myPrecomputed
;
145
147
mutable
unsigned
int
myLastUsed
;
148
150
std::vector<RORoute*>
myAlternatives
;
151
153
mutable
bool
myNewRoute
;
154
155
const
bool
myTryRepair
;
156
157
private
:
159
struct
ComparatorProbability
{
160
bool
operator()
(
const
RORoute
*
const
a,
const
RORoute
*
const
b) {
161
return
a->
getProbability
() > b->
getProbability
();
162
}
163
};
164
165
private
:
167
RORouteDef
(
const
RORouteDef
& src);
168
170
RORouteDef
&
operator=
(
const
RORouteDef
& src);
171
172
};
173
174
175
#endif
176
177
/****************************************************************************/
178
build
buildd
sumo-0.16.0~dfsg
src
router
RORouteDef.h
Generated on Tue Apr 16 2013 01:32:20 for SUMO - Simulation of Urban MObility by
1.8.3.1