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