SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGStreet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Represents a SUMO edge and contains people and work densities
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 // activitygen module
14 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
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 "AGStreet.h"
36 #include "router/ROEdge.h"
37 #include <iostream>
38 
39 
40 // ===========================================================================
41 // method definitions
42 // ===========================================================================
43 AGStreet::AGStreet(const ROEdge* edge, SUMOReal popDensity, SUMOReal workDensity) :
44  edge(edge) {
45  pop = popDensity * edge->getLength();
46  work = workDensity * edge->getLength();
47 }
48 
49 
50 void
51 AGStreet::print() const {
52  std::cout << "- AGStreet: Name=" << edge->getID() << " Length=" << edge->getLength() << " pop=" << pop << " work=" << work << std::endl;
53 }
54 
55 
58  return edge->getLength();
59 }
60 
61 
62 const std::string&
64  return edge->getID();
65 }
66 
67 
70  return pop;
71 }
72 
73 
74 void
75 AGStreet::setPopulation(const SUMOReal population) {
76  pop = population;
77 }
78 
79 
82  return work;
83 }
84 
85 
86 void
87 AGStreet::setWorkplaceNumber(const SUMOReal workPositions) {
88  work = workPositions;
89 }
90 
91 /****************************************************************************/
SUMOReal getLength() const
Provides the length of this edge.
Definition: AGStreet.cpp:57
const std::string & getID() const
Returns the id.
Definition: Named.h:60
SUMOReal work
Definition: AGStreet.h:107
const std::string & getName() const
Provides the id of this edge.
Definition: AGStreet.cpp:63
SUMOReal getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:81
A basic edge for routing applications.
Definition: ROEdge.h:67
SUMOReal pop
Definition: AGStreet.h:106
AGStreet(const ROEdge *edge, SUMOReal popD=0, SUMOReal workD=0)
Definition: AGStreet.cpp:43
const ROEdge * edge
Definition: AGStreet.h:105
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:158
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:51
SUMOReal getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:69
void setWorkplaceNumber(const SUMOReal work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:87
#define SUMOReal
Definition: config.h:221
void setPopulation(const SUMOReal pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:75