Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/activitygen/city/AGPerson.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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 are made available under the
7
// terms of the Eclipse Public License 2.0 which is available at
8
// https://www.eclipse.org/legal/epl-2.0/
9
// This Source Code may also be made available under the following Secondary
10
// Licenses when the conditions for such availability set forth in the Eclipse
11
// Public License 2.0 are satisfied: GNU General Public License, version 2
12
// or later which is available at
13
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15
/****************************************************************************/
16
/// @file AGPerson.h
17
/// @author Piotr Woznica
18
/// @author Walter Bamberger
19
/// @author Daniel Krajzewicz
20
/// @date July 2010
21
///
22
// Parent object of every person, contains age and any natural characteristic
23
/****************************************************************************/
24
#pragma once
25
#include <config.h>
26
27
28
// ===========================================================================
29
// class definitions
30
// ===========================================================================
31
/**
32
* @class AGPerson
33
* @brief Base class of every person in the city (adults and children)
34
*
35
* This class provides the functionality common to all person in the city. It
36
* is a base class for other classes and is not intended to be instantiated
37
* as an object. Therefore, all constructors are protected.
38
*/
39
class AGPerson {
40
public:
41
/** @brief Provides the age of the person.
42
*
43
* @return the age in years
44
*/
45
virtual int getAge() const;
46
47
/** @brief Lets the person make a decision.
48
*
49
* The higher the degree of belief is, the more likely this method returns
50
* true.
51
*
52
* @param[in] degreeOfBelief how strong the person beliefs the proposition
53
* @return whether the person agrees with the proposition
54
*/
55
virtual bool decide(double probability) const;
56
57
/** @brief Puts out a summary of the class properties.
58
*/
59
virtual void print() const;
60
61
protected:
62
int age;
63
64
/** @brief Initialises the class attributes.
65
*
66
* @param[in] age the age of the person
67
*/
68
AGPerson(int age);
69
70
/** @brief Cleans up everything.
71
*/
72
virtual ~AGPerson();
73
};
74
75