Eclipse 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-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 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include "AGStreet.h"
30 #include "router/ROEdge.h"
31 #include <iostream>
32 
33 
34 // ===========================================================================
35 // method definitions
36 // ===========================================================================
37 AGStreet::AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority) :
38  ROEdge(id, from, to, index, priority), myPopulation(0.), myNumWorkplaces(0.) {
39 }
40 
41 
42 void
43 AGStreet::print() const {
44  std::cout << "- AGStreet: Name=" << getID() << " Length=" << getLength() << " pop=" << myPopulation << " work=" << myNumWorkplaces << std::endl;
45 }
46 
47 
48 double
50  return myPopulation;
51 }
52 
53 
54 void
55 AGStreet::setPopulation(const double population) {
56  myPopulation = population;
57 }
58 
59 
60 double
62  return myNumWorkplaces;
63 }
64 
65 
66 void
67 AGStreet::setWorkplaceNumber(const double workPositions) {
68  myNumWorkplaces = workPositions;
69 }
70 
71 
72 bool
73 AGStreet::allows(const SUMOVehicleClass vclass) const {
74  return (getPermissions() & vclass) == vclass;
75 }
76 
77 
78 /****************************************************************************/
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.h
AGStreet::setWorkplaceNumber
void setWorkplaceNumber(const double work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:67
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
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
ROEdge::getLength
double getLength() const
Returns the length of the edge.
Definition: ROEdge.h:203
ROEdge::getPermissions
SVCPermissions getPermissions() const
Definition: ROEdge.h:267
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:73
config.h
AGStreet::myNumWorkplaces
double myNumWorkplaces
Definition: AGStreet.h:110
RONode
Base class for nodes used by the router.
Definition: RONode.h:46
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
ROEdge.h