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
NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp
Go to the documentation of this file.
1
/****************************************************************************/
8
//
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
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
22
23
// ===========================================================================
24
// included modules
25
// ===========================================================================
26
#ifdef _MSC_VER
27
#include <
windows_config.h
>
28
#else
29
#include <
config.h
>
30
#endif
31
32
#include <iostream>
33
#include <vector>
34
#include <cassert>
35
#include <
utils/common/TplConvert.h
>
36
#include "../NIImporter_Vissim.h"
37
#include "../tempstructs/NIVissimEdge.h"
38
#include "../tempstructs/NIVissimConnection.h"
39
#include "
NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h
"
40
41
#ifdef CHECK_MEMORY_LEAKS
42
#include <
foreign/nvwa/debug_new.h
>
43
#endif // CHECK_MEMORY_LEAKS
44
45
46
// ===========================================================================
47
// method definitions
48
// ===========================================================================
49
NIVissimSingleTypeParser_VWunschentscheidungsdefinition::NIVissimSingleTypeParser_VWunschentscheidungsdefinition
(
NIImporter_Vissim
& parent)
50
:
NIImporter_Vissim
::VissimSingleTypeParser(parent) {}
51
52
53
NIVissimSingleTypeParser_VWunschentscheidungsdefinition::~NIVissimSingleTypeParser_VWunschentscheidungsdefinition
() {}
54
55
56
bool
57
NIVissimSingleTypeParser_VWunschentscheidungsdefinition::parse
(std::istream& from) {
58
std::string tag;
59
from >> tag;
// id
60
from >> tag;
// name
61
tag =
readName
(from);
62
tag =
overrideOptionalLabel
(from);
63
from >> tag;
// strecke
64
std::string edgeid;
65
from >> edgeid;
66
from >> tag;
// spur
67
std::string lane;
68
from >> lane;
69
from >> tag;
// bei
70
std::string pos;
71
from >> pos;
72
from >> tag;
// fahrzeugklasse
73
from >> tag;
// <fahrzeugklasse>
74
from >> tag;
// vwunsch
75
std::string vwunsch;
76
from >> vwunsch;
// vwunsch
77
std::vector<std::string> tmp;
78
tmp.push_back(
"zeit"
);
79
tmp.push_back(
"fahrzeugklasse"
);
80
tag =
readEndSecure
(from, tmp);
81
while
(tag !=
"DATAEND"
&& tag !=
"zeit"
) {
82
from >> tag;
83
from >> tag;
84
from >> tag;
85
tag =
myRead
(from);
86
}
87
if
(tag ==
"zeit"
) {
88
from >> tag;
89
from >> tag;
90
from >> tag;
91
from >> tag;
92
}
93
int
numid =
TplConvert::_2int
(edgeid.c_str());
94
int
numlane =
TplConvert::_2int
(lane.c_str()) - 1;
95
int
numv =
TplConvert::_2int
(vwunsch.c_str());
96
NIVissimEdge
* e =
NIVissimEdge::dictionary
(numid);
97
if
(e == 0) {
98
NIVissimConnection
* c =
NIVissimConnection::dictionary
(numid);
99
const
std::vector<int>& lanes = c->
getToLanes
();
100
e =
NIVissimEdge::dictionary
(c->
getToEdgeID
());
101
for
(std::vector<int>::const_iterator j = lanes.begin(); j != lanes.end(); j++) {
102
e->setSpeed((*j), numv);
103
}
104
assert(e != 0);
105
}
else
{
106
e->setSpeed(numlane, numv);
107
}
108
return
true
;
109
}
110
111
112
113
/****************************************************************************/
114
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
netimport
vissim
typeloader
NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp
Generated on Sun Jun 16 2013 07:08:07 for SUMO - Simulation of Urban MObility by
1.8.1.2