SUMO - Simulation of Urban MObility
AGStreet.cpp
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 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include "AGStreet.h"
36 #include "router/ROEdge.h"
37 #include <iostream>
38 
39 
40 // ===========================================================================
41 // method definitions
42 // ===========================================================================
43 AGStreet::AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority) :
44  ROEdge(id, from, to, index, priority), myPopulation(0.), myNumWorkplaces(0.) {
45 }
46 
47 
48 void
49 AGStreet::print() const {
50  std::cout << "- AGStreet: Name=" << getID() << " Length=" << getLength() << " pop=" << myPopulation << " work=" << myNumWorkplaces << std::endl;
51 }
52 
53 
54 double
56  return myPopulation;
57 }
58 
59 
60 void
61 AGStreet::setPopulation(const double population) {
62  myPopulation = population;
63 }
64 
65 
66 double
68  return myNumWorkplaces;
69 }
70 
71 
72 void
73 AGStreet::setWorkplaceNumber(const double workPositions) {
74  myNumWorkplaces = workPositions;
75 }
76 
77 
78 bool
79 AGStreet::allows(const SUMOVehicleClass vclass) const {
80  return (getPermissions() & vclass) == vclass;
81 }
82 
83 
84 /****************************************************************************/
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
double getLength() const
Returns the length of the edge.
Definition: ROEdge.h:204
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:43
const std::string & getID() const
Returns the id.
Definition: Named.h:65
SVCPermissions getPermissions() const
Definition: ROEdge.h:274
double myPopulation
Definition: AGStreet.h:115
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