SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2016 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 
57  return myPopulation;
58 }
59 
60 
61 void
62 AGStreet::setPopulation(const SUMOReal population) {
63  myPopulation = population;
64 }
65 
66 
69  return myNumWorkplaces;
70 }
71 
72 
73 void
74 AGStreet::setWorkplaceNumber(const SUMOReal 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...
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Definition: AGStreet.cpp:44
bool allows(const SUMOVehicleClass vclass) const
Returns whether the given vehicle class is allowed on this street.
Definition: AGStreet.cpp:80
const std::string & getID() const
Returns the id.
Definition: Named.h:66
SUMOReal getWorkplaceNumber() const
Provides the number of work places in this street.
Definition: AGStreet.cpp:68
A basic edge for routing applications.
Definition: ROEdge.h:77
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:198
SUMOReal myNumWorkplaces
Definition: AGStreet.h:117
void print() const
Prints a summary of the properties of this street to standard output.
Definition: AGStreet.cpp:50
SUMOReal getPopulation() const
Provides the number of persons living in this street.
Definition: AGStreet.cpp:56
void setWorkplaceNumber(const SUMOReal work)
Modifies the number of work places in this street.
Definition: AGStreet.cpp:74
#define SUMOReal
Definition: config.h:214
void setPopulation(const SUMOReal pop)
Modifies the number of persons living in this street.
Definition: AGStreet.cpp:62
Base class for nodes used by the router.
Definition: RONode.h:53
SVCPermissions getPermissions() const
Definition: ROEdge.h:258
SUMOReal myPopulation
Definition: AGStreet.h:116