SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Cars owned by people of the city: included in households. 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 // activitygen module 00014 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00015 /****************************************************************************/ 00016 // 00017 // This file is part of SUMO. 00018 // SUMO is free software: you can redistribute it and/or modify 00019 // it under the terms of the GNU General Public License as published by 00020 // the Free Software Foundation, either version 3 of the License, or 00021 // (at your option) any later version. 00022 // 00023 /****************************************************************************/ 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <iostream> 00036 #include <sstream> 00037 #include <string> 00038 #include "AGCar.h" 00039 #include "AGAdult.h" 00040 00041 00042 // =========================================================================== 00043 // method definitions 00044 // =========================================================================== 00045 std::string 00046 AGCar::createName(int idHH, int idCar) { 00047 std::ostringstream os; 00048 os << "h" << idHH << "c" << idCar; 00049 return os.str(); 00050 } 00051 00052 bool 00053 AGCar::associateTo(AGAdult* pers) { 00054 if (currentUser == NULL) { 00055 currentUser = pers; 00056 return true; 00057 } 00058 return false; 00059 } 00060 00061 bool 00062 AGCar::isAssociated() { 00063 return (currentUser != NULL); 00064 } 00065 00066 std::string 00067 AGCar::getName() { 00068 return idName; 00069 } 00070 00071 /****************************************************************************/