LCOV - code coverage report
Current view: top level - src/activitygen/city - AGStreet.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 83.3 % 18 15
Test Date: 2025-11-13 15:38:19 Functions: 85.7 % 7 6

            Line data    Source code
       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              : /****************************************************************************/
      16              : /// @file    AGStreet.cpp
      17              : /// @author  Piotr Woznica
      18              : /// @author  Walter Bamberger
      19              : /// @author  Daniel Krajzewicz
      20              : /// @author  Michael Behrisch
      21              : /// @date    July 2010
      22              : ///
      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              : // ===========================================================================
      35         2660 : AGStreet::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         2660 :     myPopulation(0.), myNumWorkplaces(0.) {
      38         2660 : }
      39              : 
      40              : 
      41              : void
      42            0 : AGStreet::print() const {
      43            0 :     std::cout << "- AGStreet: Name=" << getID() << " Length=" << getLength() << " pop=" << myPopulation << " work=" << myNumWorkplaces << std::endl;
      44            0 : }
      45              : 
      46              : 
      47              : double
      48          696 : AGStreet::getPopulation() const {
      49          696 :     return myPopulation;
      50              : }
      51              : 
      52              : 
      53              : void
      54          228 : AGStreet::setPopulation(const double population) {
      55          228 :     myPopulation = population;
      56          228 : }
      57              : 
      58              : 
      59              : double
      60         3866 : AGStreet::getWorkplaceNumber() const {
      61         3866 :     return myNumWorkplaces;
      62              : }
      63              : 
      64              : 
      65              : void
      66          228 : AGStreet::setWorkplaceNumber(const double workPositions) {
      67          228 :     myNumWorkplaces = workPositions;
      68          228 : }
      69              : 
      70              : 
      71              : bool
      72         1114 : AGStreet::allows(const SUMOVehicleClass vclass) const {
      73         1114 :     return (getPermissions() & vclass) == vclass;
      74              : }
      75              : 
      76              : 
      77              : /****************************************************************************/
        

Generated by: LCOV version 2.0-1