NIVissimSingleTypeParser_Parkplatzdefinition.cpp
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029
00030 #include <iostream>
00031 #include <vector>
00032 #include <utility>
00033 #include <utils/common/TplConvert.h>
00034 #include <utils/common/ToString.h>
00035 #include <utils/common/VectorHelper.h>
00036 #include <netbuild/NBDistrictCont.h>
00037 #include <netbuild/NBDistrict.h>
00038 #include <netbuild/NBNode.h>
00039 #include <netbuild/NBNodeCont.h>
00040 #include "../NIImporter_Vissim.h"
00041 #include "../tempstructs/NIVissimDistrictConnection.h"
00042 #include "NIVissimSingleTypeParser_Parkplatzdefinition.h"
00043
00044 #ifdef CHECK_MEMORY_LEAKS
00045 #include <foreign/nvwa/debug_new.h>
00046 #endif // CHECK_MEMORY_LEAKS
00047
00048
00049
00050
00051
00052 NIVissimSingleTypeParser_Parkplatzdefinition::NIVissimSingleTypeParser_Parkplatzdefinition(NIImporter_Vissim &parent)
00053 : NIImporter_Vissim::VissimSingleTypeParser(parent) {}
00054
00055
00056 NIVissimSingleTypeParser_Parkplatzdefinition::~NIVissimSingleTypeParser_Parkplatzdefinition() {}
00057
00058
00059 bool
00060 NIVissimSingleTypeParser_Parkplatzdefinition::parse(std::istream &from) {
00061 int id;
00062 from >> id;
00063
00064 std::string tag;
00065 from >> tag;
00066 std::string name = readName(from);
00067
00068
00069
00070
00071
00072 IntVector districts;
00073 DoubleVector percentages;
00074 readUntil(from, "bezirke");
00075 while (tag!="ort") {
00076 SUMOReal perc = -1;
00077 int districtid;
00078 from >> districtid;
00079 tag = myRead(from);
00080 if (tag=="anteil") {
00081 from >> perc;
00082 }
00083 districts.push_back(districtid);
00084 percentages.push_back(perc);
00085 tag = myRead(from);
00086 }
00087
00088 from >> tag;
00089 int edgeid;
00090 from >> edgeid;
00091
00092 SUMOReal position;
00093 from >> tag;
00094 from >> position;
00095
00096 SUMOReal length;
00097 from >> tag;
00098 from >> length;
00099
00100 from >> tag;
00101 from >> tag;
00102
00103 tag = myRead(from);
00104 if (tag=="belegung") {
00105 from >> tag;
00106 tag = myRead(from);
00107 }
00108
00109 std::vector<std::pair<int, int> > assignedVehicles;
00110 while (tag!="default") {
00111 int vclass;
00112 from >> vclass;
00113 from >> tag;
00114 int vwunsch;
00115 from >> vwunsch;
00116 assignedVehicles.push_back(std::pair<int, int>(vclass, vwunsch));
00117 tag = myRead(from);
00118 }
00119
00120 from >> tag;
00121 from >> tag;
00122
00123
00124
00125
00126 return NIVissimDistrictConnection::dictionary(id, name,
00127 districts, percentages, edgeid, position, assignedVehicles);
00128 }
00129
00130
00131
00132
00133