Eclipse 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-2019 German Aerospace Center (DLR) and others.
4
// activitygen module
5
// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6
// This program and the accompanying materials
7
// are made available under the terms of the Eclipse Public License v2.0
8
// which accompanies this distribution, and is available at
9
// http://www.eclipse.org/legal/epl-v20.html
10
// SPDX-License-Identifier: EPL-2.0
11
/****************************************************************************/
19
// Cars owned by people of the city: included in households.
20
/****************************************************************************/
21
22
23
// ===========================================================================
24
// included modules
25
// ===========================================================================
26
#include <
config.h
>
27
28
#include <iostream>
29
#include <sstream>
30
#include <string>
31
#include "
AGCar.h
"
32
#include "
AGAdult.h
"
33
34
35
// ===========================================================================
36
// method definitions
37
// ===========================================================================
38
std::string
39
AGCar::createName
(
int
idHH,
int
idCar) {
40
std::ostringstream os;
41
os <<
"h"
<< idHH <<
"c"
<< idCar;
42
return
os.str();
43
}
44
45
bool
46
AGCar::associateTo
(
AGAdult
* pers) {
47
if
(
currentUser
==
nullptr
) {
48
currentUser
= pers;
49
return
true
;
50
}
51
return
false
;
52
}
53
54
bool
55
AGCar::isAssociated
()
const
{
56
return
(
currentUser
!=
nullptr
);
57
}
58
59
std::string
60
AGCar::getName
()
const
{
61
return
idName
;
62
}
63
64
/****************************************************************************/
AGCar::idName
std::string idName
Definition:
AGCar.h:51
AGCar::associateTo
bool associateTo(AGAdult *pers)
Definition:
AGCar.cpp:46
AGCar::isAssociated
bool isAssociated() const
Definition:
AGCar.cpp:55
AGAdult.h
AGCar.h
AGCar::getName
std::string getName() const
Definition:
AGCar.cpp:60
AGCar::createName
std::string createName(int idHH, int idCar)
Definition:
AGCar.cpp:39
config.h
AGAdult
An adult person who can have a job.
Definition:
AGAdult.h:50
AGCar::currentUser
AGAdult * currentUser
Definition:
AGCar.h:52
src
activitygen
city
AGCar.cpp
Generated on Sun Dec 13 2020 08:44:58 for Eclipse SUMO - Simulation of Urban MObility by
1.8.20