SUMO - Simulation of Urban MObility
AGStreet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Represents a SUMO edge and contains people and work densities
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 "AGStreet.h"
37 #include "router/ROEdge.h"
38 #include <iostream>
39 
40 
41 // ===========================================================================
42 // method definitions
43 // ===========================================================================
44 AGStreet::AGStreet(const ROEdge* edge, SUMOReal popDensity, SUMOReal workDensity) :
45  edge(edge) {
46  pop = popDensity * edge->getLength();
47  work = workDensity * edge->getLength();
48 }
49 
50 
51 void
52 AGStreet::print() const {
53  std::cout << "- AGStreet: Name=" << edge->getID() << " Length=" << edge->getLength() << " pop=" << pop << " work=" << work << std::endl;
54 }
55 
56 
59  return edge->getLength();
60 }
61 
62 
63 const std::string&
65  return edge->getID();
66 }
67 
68 
71  return pop;
72 }
73 
74 
75 void
76 AGStreet::setPopulation(const SUMOReal population) {
77  pop = population;
78 }
79 
80 
83  return work;
84 }
85 
86 
87 void
88 AGStreet::setWorkplaceNumber(const SUMOReal workPositions) {
89  work = workPositions;
90 }
91 
92 /****************************************************************************/
SUMOReal getLength() const
Provides the length of this edge.
Definition: AGStreet.cpp:58
const std::string & getID() const
Returns the id.
Definition: Named.h:60
SUMOReal work
Definition: AGStreet.h:108
const std::string & getName() const
Provides the id of this edge.
Definition: AGStreet.cpp:64
SUMOReal getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:82
A basic edge for routing applications.
Definition: ROEdge.h:69
SUMOReal pop
Definition: AGStreet.h:107
AGStreet(const ROEdge *edge, SUMOReal popD=0, SUMOReal workD=0)
Definition: AGStreet.cpp:44
const ROEdge * edge
Definition: AGStreet.h:106
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:180
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:52
SUMOReal getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:70
void setWorkplaceNumber(const SUMOReal work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:88
#define SUMOReal
Definition: config.h:215
void setPopulation(const SUMOReal pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:76