SUMO - Simulation of Urban MObility
AGCar.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2017 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
22 // Cars owned by people of the city: included in households.
23 /****************************************************************************/
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <iostream>
36 #include <sstream>
37 #include <string>
38 #include "AGCar.h"
39 #include "AGAdult.h"
40 
41 
42 // ===========================================================================
43 // method definitions
44 // ===========================================================================
45 std::string
46 AGCar::createName(int idHH, int idCar) {
47  std::ostringstream os;
48  os << "h" << idHH << "c" << idCar;
49  return os.str();
50 }
51 
52 bool
54  if (currentUser == NULL) {
55  currentUser = pers;
56  return true;
57  }
58  return false;
59 }
60 
61 bool
63  return (currentUser != NULL);
64 }
65 
66 std::string
67 AGCar::getName() const {
68  return idName;
69 }
70 
71 /****************************************************************************/
std::string idName
Definition: AGCar.h:58
An adult person who can have a job.
Definition: AGAdult.h:57
bool associateTo(AGAdult *pers)
Definition: AGCar.cpp:53
AGAdult * currentUser
Definition: AGCar.h:59
std::string getName() const
Definition: AGCar.cpp:67
std::string createName(int idHH, int idCar)
Definition: AGCar.cpp:46
bool isAssociated() const
Definition: AGCar.cpp:62