SUMO - Simulation of Urban MObility
AGStreet.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2017 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
22 // Represents a SUMO edge and contains people and work densities
23 /****************************************************************************/
24 #ifndef AGSTREET_H
25 #define AGSTREET_H
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <string>
40 #include <router/ROEdge.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class AGPosition;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
59 class AGStreet : public ROEdge {
60 public:
61  class Builder : public ROAbstractEdgeBuilder {
62  public:
71  ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) {
72  return new AGStreet(name, from, to, getNextIndex(), priority);
73  }
74  };
75 
76  AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority);
77 
82  double getPopulation() const;
83 
88  void setPopulation(const double pop);
89 
94  double getWorkplaceNumber() const;
95 
100  void setWorkplaceNumber(const double work);
101 
105  void print() const;
106 
112  bool allows(const SUMOVehicleClass vclass) const;
113 
114 private:
115  double myPopulation;
117 };
118 
119 #endif
120 
121 /****************************************************************************/
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void setWorkplaceNumber(const double work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:73
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:62
ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)
Builds an edge with the given name.
Definition: AGStreet.h:71
A model of the street in the city.
Definition: AGStreet.h:59
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:43
Interface for building instances of router-edges.
double myPopulation
Definition: AGStreet.h:115
int getNextIndex()
Returns the index of the edge to built.
double getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:67
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:49
A basic edge for routing applications.
Definition: ROEdge.h:77
bool allows(const SUMOVehicleClass vclass) const
Returns whether the given vehicle class is allowed on this street.
Definition: AGStreet.cpp:79
void setPopulation(const double pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:61
double getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:55
Base class for nodes used by the router.
Definition: RONode.h:52
double myNumWorkplaces
Definition: AGStreet.h:116