Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
19 // Represents a SUMO edge and contains people and work densities
20 /****************************************************************************/
21 #ifndef AGSTREET_H
22 #define AGSTREET_H
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <string>
33 #include <router/ROEdge.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class AGPosition;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
52 class AGStreet : public ROEdge {
53 public:
54  class Builder : public ROAbstractEdgeBuilder {
55  public:
64  ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) {
65  return new AGStreet(name, from, to, getNextIndex(), priority);
66  }
67  };
68 
69  AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority);
70 
75  double getPopulation() const;
76 
81  void setPopulation(const double pop);
82 
87  double getWorkplaceNumber() const;
88 
93  void setWorkplaceNumber(const double work);
94 
98  void print() const;
99 
105  bool allows(const SUMOVehicleClass vclass) const;
106 
107 private:
108  double myPopulation;
110 };
111 
112 #endif
113 
114 /****************************************************************************/
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
AGStreet::AGStreet
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:36
AGStreet::Builder
Definition: AGStreet.h:54
AGStreet::setWorkplaceNumber
void setWorkplaceNumber(const double work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:66
ROAbstractEdgeBuilder::getNextIndex
int getNextIndex()
Returns the index of the edge to built.
Definition: ROAbstractEdgeBuilder.h:82
AGStreet::myPopulation
double myPopulation
Definition: AGStreet.h:108
AGStreet::getWorkplaceNumber
double getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:60
ROAbstractEdgeBuilder.h
SUMOVehicleClass.h
AGStreet
A model of the street in the city.
Definition: AGStreet.h:52
AGStreet::allows
bool allows(const SUMOVehicleClass vclass) const
Returns whether the given vehicle class is allowed on this street.
Definition: AGStreet.cpp:72
AGStreet::setPopulation
void setPopulation(const double pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:54
AGStreet::getPopulation
double getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:48
AGStreet::print
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:42
AGPosition
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:55
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
config.h
AGStreet::myNumWorkplaces
double myNumWorkplaces
Definition: AGStreet.h:109
AGStreet::Builder::buildEdge
ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)
Builds an edge with the given name.
Definition: AGStreet.h:64
RONode
Base class for nodes used by the router.
Definition: RONode.h:45
ROEdge.h
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:53