Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGStreet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2010-2025 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 are made available under the
7// terms of the Eclipse Public License 2.0 which is available at
8// https://www.eclipse.org/legal/epl-2.0/
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License 2.0 are satisfied: GNU General Public License, version 2
12// or later which is available at
13// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15/****************************************************************************/
23// Represents a SUMO edge and contains people and work densities
24/****************************************************************************/
25#include <config.h>
26
27#include "AGStreet.h"
28#include "router/ROEdge.h"
29#include <iostream>
30
31
32// ===========================================================================
33// method definitions
34// ===========================================================================
35AGStreet::AGStreet(const std::string& id, RONode* from, RONode* to, int index, const int priority, const std::string& type, const std::string& routingType) :
36 ROEdge(id, from, to, index, priority, type, routingType),
37 myPopulation(0.), myNumWorkplaces(0.) {
38}
39
40
41void
43 std::cout << "- AGStreet: Name=" << getID() << " Length=" << getLength() << " pop=" << myPopulation << " work=" << myNumWorkplaces << std::endl;
44}
45
46
47double
49 return myPopulation;
50}
51
52
53void
54AGStreet::setPopulation(const double population) {
55 myPopulation = population;
56}
57
58
59double
63
64
65void
66AGStreet::setWorkplaceNumber(const double workPositions) {
67 myNumWorkplaces = workPositions;
68}
69
70
71bool
73 return (getPermissions() & vclass) == vclass;
74}
75
76
77/****************************************************************************/
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:66
AGStreet(const std::string &id, RONode *from, RONode *to, int index, const int priority, const std::string &type, const std::string &routingType)
Definition AGStreet.cpp:35
void print() const
Prints a summary of the properties of this street to standard output.
Definition AGStreet.cpp:42
double myPopulation
Definition AGStreet.h:106
double getPopulation() const
Provides the number of persons living in this street.
Definition AGStreet.cpp:48
void setPopulation(const double pop)
Modifies the number of persons living in this street.
Definition AGStreet.cpp:54
double getWorkplaceNumber() const
Provides the number of work places in this street.
Definition AGStreet.cpp:60
bool allows(const SUMOVehicleClass vclass) const
Returns whether the given vehicle class is allowed on this street.
Definition AGStreet.cpp:72
double myNumWorkplaces
Definition AGStreet.h:107
const std::string & getID() const
Returns the id.
Definition Named.h:74
A basic edge for routing applications.
Definition ROEdge.h:73
SVCPermissions getPermissions() const
Definition ROEdge.h:289
double getLength() const
Returns the length of the edge.
Definition ROEdge.h:225
Base class for nodes used by the router.
Definition RONode.h:46