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 /****************************************************************************/
20 // Represents a SUMO edge and contains people and work densities
21 /****************************************************************************/
22 #ifndef AGSTREET_H
23 #define AGSTREET_H
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #include <config.h>
30 
31 #include <string>
34 #include <router/ROEdge.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class AGPosition;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
53 class AGStreet : public ROEdge {
54 public:
55  class Builder : public ROAbstractEdgeBuilder {
56  public:
65  ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) {
66  return new AGStreet(name, from, to, getNextIndex(), priority);
67  }
68  };
69 
70  AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority);
71 
76  double getPopulation() const;
77 
82  void setPopulation(const double pop);
83 
88  double getWorkplaceNumber() const;
89 
94  void setWorkplaceNumber(const double work);
95 
99  void print() const;
100 
106  bool allows(const SUMOVehicleClass vclass) const;
107 
108 private:
109  double myPopulation;
111 };
112 
113 #endif
114 
115 /****************************************************************************/
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
AGStreet::AGStreet
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:37
AGStreet::Builder
Definition: AGStreet.h:55
AGStreet::setWorkplaceNumber
void setWorkplaceNumber(const double work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:67
ROAbstractEdgeBuilder::getNextIndex
int getNextIndex()
Returns the index of the edge to built.
Definition: ROAbstractEdgeBuilder.h:83
AGStreet::myPopulation
double myPopulation
Definition: AGStreet.h:109
AGStreet::getWorkplaceNumber
double getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:61
ROAbstractEdgeBuilder.h
SUMOVehicleClass.h
AGStreet
A model of the street in the city.
Definition: AGStreet.h:53
AGStreet::allows
bool allows(const SUMOVehicleClass vclass) const
Returns whether the given vehicle class is allowed on this street.
Definition: AGStreet.cpp:73
AGStreet::setPopulation
void setPopulation(const double pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:55
AGStreet::getPopulation
double getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:49
AGStreet::print
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:43
AGPosition
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:56
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:73
config.h
AGStreet::myNumWorkplaces
double myNumWorkplaces
Definition: AGStreet.h:110
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:65
RONode
Base class for nodes used by the router.
Definition: RONode.h:46
ROEdge.h
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:54