SUMO - Simulation of Urban MObility
AGStreet.h
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.dlr.de/
13 // Copyright (C) 2010-2016 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 #ifndef AGSTREET_H
26 #define AGSTREET_H
27 
28 
29 // ===========================================================================
30 // included modules
31 // ===========================================================================
32 #ifdef _MSC_VER
33 #include <windows_config.h>
34 #else
35 #include <config.h>
36 #endif
37 
38 #include <string>
41 #include <router/ROEdge.h>
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class AGPosition;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
60 class AGStreet : public ROEdge {
61 public:
62  class Builder : public ROAbstractEdgeBuilder {
63  public:
72  ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) {
73  return new AGStreet(name, from, to, getNextIndex(), priority);
74  }
75  };
76 
77  AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority);
78 
83  SUMOReal getPopulation() const;
84 
89  void setPopulation(const SUMOReal pop);
90 
96 
101  void setWorkplaceNumber(const SUMOReal work);
102 
106  void print() const;
107 
113  bool allows(const SUMOVehicleClass vclass) const;
114 
115 private:
118 };
119 
120 #endif
121 
122 /****************************************************************************/
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:63
ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)
Builds an edge with the given name.
Definition: AGStreet.h:72
A model of the street in the city.
Definition: AGStreet.h:60
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:44
Interface for building instances of router-edges.
SUMOReal getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:68
SUMOReal getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:56
int getNextIndex()
Returns the index of the edge to built.
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:50
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:80
SUMOReal myNumWorkplaces
Definition: AGStreet.h:117
void setWorkplaceNumber(const SUMOReal work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:74
#define SUMOReal
Definition: config.h:213
void setPopulation(const SUMOReal pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:62
Base class for nodes used by the router.
Definition: RONode.h:53
SUMOReal myPopulation
Definition: AGStreet.h:116