|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Cars owned by people of the city: included in households. 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 // activitygen module 00012 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00013 /****************************************************************************/ 00014 // 00015 // This program 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 2 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 <sstream> 00034 #include <string> 00035 #include "AGCar.h" 00036 #include "AGAdult.h" 00037 00038 00039 // =========================================================================== 00040 // method definitions 00041 // =========================================================================== 00042 std::string 00043 AGCar::createName(int idHH, int idCar) { 00044 std::ostringstream os; 00045 os << "h" << idHH << "c" << idCar; 00046 return os.str(); 00047 } 00048 00049 bool 00050 AGCar::associateTo(AGAdult* pers) { 00051 if (currentUser == NULL) { 00052 currentUser = pers; 00053 return true; 00054 } 00055 return false; 00056 } 00057 00058 bool 00059 AGCar::isAssociated() { 00060 return (currentUser != NULL); 00061 } 00062 00063 std::string 00064 AGCar::getName() { 00065 return idName; 00066 } 00067 00068 /****************************************************************************/