SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
AGPerson.cpp
Go to the documentation of this file.
1
/****************************************************************************/
10
// Parent object of every person, contains age and any natural characteristic
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 "
AGPerson.h
"
37
#include <
utils/common/RandHelper.h
>
38
#include <iostream>
39
40
41
// ===========================================================================
42
// method definitions
43
// ===========================================================================
44
AGPerson::AGPerson
(
int
age) : age(age) {}
45
46
47
AGPerson::~AGPerson
() {}
48
49
50
void
51
AGPerson::print
()
const
{
52
std::cout <<
"- Person: Age="
<<
age
<< std::endl;
53
}
54
55
56
int
57
AGPerson::getAge
()
const
{
58
return
age
;
59
}
60
61
62
bool
63
AGPerson::decide
(
SUMOReal
proba)
const
{
64
return
(
RandHelper::rand
(1000) < static_cast<int>(1000.0f * proba));
65
}
66
67
/****************************************************************************/
tmp
buildd
sumo-0.21.0+dfsg
src
activitygen
city
AGPerson.cpp
Generated on Thu Nov 20 2014 19:49:52 for SUMO - Simulation of Urban MObility by
1.8.1.2