SUMO - Simulation of Urban MObility
AGCar.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Cars owned by people of the city: included in households.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors
14 // activitygen module
15 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <iostream>
37 #include <sstream>
38 #include <string>
39 #include "AGCar.h"
40 #include "AGAdult.h"
41 
42 
43 // ===========================================================================
44 // method definitions
45 // ===========================================================================
46 std::string
47 AGCar::createName(int idHH, int idCar) {
48  std::ostringstream os;
49  os << "h" << idHH << "c" << idCar;
50  return os.str();
51 }
52 
53 bool
55  if (currentUser == NULL) {
56  currentUser = pers;
57  return true;
58  }
59  return false;
60 }
61 
62 bool
64  return (currentUser != NULL);
65 }
66 
67 std::string
68 AGCar::getName() const {
69  return idName;
70 }
71 
72 /****************************************************************************/
std::string getName() const
Definition: AGCar.cpp:68
std::string idName
Definition: AGCar.h:59
An adult person who can have a job.
Definition: AGAdult.h:58
bool associateTo(AGAdult *pers)
Definition: AGCar.cpp:54
bool isAssociated() const
Definition: AGCar.cpp:63
AGAdult * currentUser
Definition: AGCar.h:60
std::string createName(int idHH, int idCar)
Definition: AGCar.cpp:47