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
ROJTRFrame.cpp
Go to the documentation of this file.
1
/****************************************************************************/
9
// Sets and checks options for jtr-routing
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
#include <iostream>
34
#include <fstream>
35
#include <ctime>
36
#include <
utils/options/OptionsCont.h
>
37
#include <
utils/options/Option.h
>
38
#include <
utils/common/MsgHandler.h
>
39
#include <
utils/common/UtilExceptions.h
>
40
#include <
utils/common/ToString.h
>
41
#include "
ROJTRFrame.h
"
42
#include <
router/ROFrame.h
>
43
#include <
utils/common/RandHelper.h
>
44
#include <
utils/common/SystemFrame.h
>
45
#include <
utils/common/SUMOVehicleParameter.h
>
46
47
#ifdef CHECK_MEMORY_LEAKS
48
#include <
foreign/nvwa/debug_new.h
>
49
#endif // CHECK_MEMORY_LEAKS
50
51
52
// ===========================================================================
53
// method definitions
54
// ===========================================================================
55
void
56
ROJTRFrame::fillOptions
() {
57
OptionsCont
& oc =
OptionsCont::getOptions
();
58
oc.
addCallExample
(
"-c <CONFIGURATION>"
,
"run with routing options defined in file"
);
59
60
// insert options sub-topics
61
SystemFrame::addConfigurationOptions
(oc);
62
oc.
addOptionSubTopic
(
"Input"
);
63
oc.
addOptionSubTopic
(
"Output"
);
64
oc.
addOptionSubTopic
(
"Processing"
);
65
oc.
addOptionSubTopic
(
"Defaults"
);
66
oc.
addOptionSubTopic
(
"Time"
);
67
SystemFrame::addReportOptions
(oc);
// fill this subtopic, too
68
69
ROFrame::fillOptions
(oc,
false
);
70
71
oc.
doRegister
(
"turn-ratio-files"
,
't'
,
new
Option_FileName
());
72
oc.
addSynonyme
(
"turn-ratio-files"
,
"turns"
);
73
oc.
addSynonyme
(
"turn-ratio-files"
,
"turn-definitions"
,
true
);
74
oc.
addDescription
(
"turn-ratio-files"
,
"Input"
,
"Read turning ratios from FILE(s)"
);
75
76
oc.
doRegister
(
"exit-times"
,
new
Option_Bool
(
false
));
77
oc.
addDescription
(
"exit-times"
,
"Output"
,
"Write exit times (weights) for each edge"
);
78
79
oc.
doRegister
(
"max-edges-factor"
,
new
Option_Float
(2.0));
80
oc.
addDescription
(
"max-edges-factor"
,
"Processing"
,
""
);
81
82
oc.
doRegister
(
"turn-defaults"
,
'T'
,
new
Option_String
(
"30,50,20"
));
83
oc.
addDescription
(
"turn-defaults"
,
"Processing"
,
"Use STR as default turn definition"
);
84
85
oc.
doRegister
(
"sink-edges"
,
's'
,
new
Option_String
());
86
oc.
addSynonyme
(
"sink-edges"
,
"sinks"
);
87
oc.
addDescription
(
"sink-edges"
,
"Processing"
,
"Use STR as list of sink edges"
);
88
89
oc.
doRegister
(
"accept-all-destinations"
,
'A'
,
new
Option_Bool
(
false
));
90
oc.
addDescription
(
"accept-all-destinations"
,
"Processing"
,
"Whether all edges are allowed as sink edges"
);
91
92
oc.
doRegister
(
"ignore-vclasses"
,
'i'
,
new
Option_Bool
(
false
));
93
oc.
addSynonyme
(
"ignore-vclasses"
,
"ignore-classes"
,
true
);
94
oc.
addDescription
(
"ignore-vclasses"
,
"Processing"
,
"Ignore road restrictions based on vehicle class"
);
95
96
oc.
doRegister
(
"allow-loops"
,
new
Option_Bool
(
false
));
97
oc.
addDescription
(
"allow-loops"
,
"Processing"
,
"Allow to re-use a road"
);
98
99
// add rand options
100
RandHelper::insertRandOptions
();
101
}
102
103
104
bool
105
ROJTRFrame::checkOptions
() {
106
OptionsCont
& oc =
OptionsCont::getOptions
();
107
bool
ok =
ROFrame::checkOptions
(oc);
108
ok &= (!oc.
isSet
(
"departlane"
) ||
SUMOVehicleParameter::departlaneValidate
(oc.
getString
(
"departlane"
)));
109
ok &= (!oc.
isSet
(
"departpos"
) ||
SUMOVehicleParameter::departposValidate
(oc.
getString
(
"departpos"
)));
110
ok &= (!oc.
isSet
(
"departspeed"
) ||
SUMOVehicleParameter::departspeedValidate
(oc.
getString
(
"departspeed"
)));
111
ok &= (!oc.
isSet
(
"arrivallane"
) ||
SUMOVehicleParameter::arrivallaneValidate
(oc.
getString
(
"arrivallane"
)));
112
ok &= (!oc.
isSet
(
"arrivalpos"
) ||
SUMOVehicleParameter::arrivalposValidate
(oc.
getString
(
"arrivalpos"
)));
113
ok &= (!oc.
isSet
(
"arrivalspeed"
) ||
SUMOVehicleParameter::arrivalspeedValidate
(oc.
getString
(
"arrivalspeed"
)));
114
return
ok;
115
}
116
117
118
119
/****************************************************************************/
120
var
build
temp
tmp.znCyBrHNjL
4.0-0-0
sumo
sumo-0.15.0~dfsg
src
jtrrouter
ROJTRFrame.cpp
Generated on Mon Mar 24 2014 09:53:14 for SUMO - Simulation of Urban MObility by
1.8.1.2