SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <iostream> 00033 #include <utils/common/TplConvert.h> 00034 #include "../NIImporter_Vissim.h" 00035 #include "../tempstructs/NIVissimVehicleClass.h" 00036 #include "../tempstructs/NIVissimVehicleClassVector.h" 00037 #include "../tempstructs/NIVissimTrafficDescription.h" 00038 #include "NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h" 00039 00040 #ifdef CHECK_MEMORY_LEAKS 00041 #include <foreign/nvwa/debug_new.h> 00042 #endif // CHECK_MEMORY_LEAKS 00043 00044 00045 // =========================================================================== 00046 // method definitions 00047 // =========================================================================== 00048 NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition::NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition(NIImporter_Vissim& parent) 00049 : NIImporter_Vissim::VissimSingleTypeParser(parent) {} 00050 00051 00052 NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition::~NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition() {} 00053 00054 00055 bool 00056 NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition::parse(std::istream& from) { 00057 // id 00058 int id; 00059 from >> id; // type-checking is missing! 00060 // name 00061 std::string tag; 00062 from >> tag; 00063 std::string name = readName(from); 00064 // assigned vehicle classes 00065 tag = myRead(from); 00066 if (tag == "temperatur") { 00067 tag = myRead(from); 00068 tag = myRead(from); 00069 } 00070 NIVissimVehicleClassVector assignedTypes; 00071 while (tag != "DATAEND") { 00072 int type; 00073 from >> type; 00074 SUMOReal percentage; 00075 from >> tag; 00076 from >> percentage; 00077 int vwish; 00078 from >> tag; 00079 from >> vwish; 00080 assignedTypes.push_back(new NIVissimVehicleClass(type, percentage, vwish)); 00081 tag = readEndSecure(from, "Fahrzeugtyp"); 00082 } 00083 // 00084 return NIVissimTrafficDescription::dictionary(id, name, assignedTypes); 00085 } 00086 00087 00088 00089 /****************************************************************************/ 00090