ra2ce.analysis.losses.traffic_intensities package#
Submodules#
ra2ce.analysis.losses.traffic_intensities.traffic_intensities module#
- GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Risk Assessment and Adaptation for Critical Infrastructure (RA2CE). Copyright (C) 2023 Stichting Deltares This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- class TrafficIntensities(*, link_id=<factory>, intensities=<factory>)[source]#
Bases:
objectClass to store the traffic intensities per day for different trip types.
- Parameters:
link_id (list[int | tuple[int, int]])
intensities (dict[tuple[TrafficPeriodEnum, TripPurposeEnum], list[int]])
- calculate_intensity(link_id, traffic_period, trip_purpose)[source]#
Calculate the traffic intensity per traffic period for a specific link for a trip purpose.
For a simplified graph, the link_id could be a tuple of link_ids. In that case the maximum intensity of the links is returned.
- Return type:
int- Parameters:
link_id (int | tuple[int, int])
traffic_period (TrafficPeriodEnum)
trip_purpose (TripPurposeEnum)
- Args:
link_id (int | tuple[int, int]): The link id(s) traffic_period (TrafficPeriodEnum): Part of the day trip_purpose (TripPurposeEnum): Trip purpose
- Returns:
int: The intensity for that (set of) link(s) (vehicles per traffic period)
-
intensities:
dict[tuple[TrafficPeriodEnum,TripPurposeEnum],list[int]]#
-
link_id:
list[int|tuple[int,int]]#
ra2ce.analysis.losses.traffic_intensities.traffic_intensities_reader module#
- GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Risk Assessment and Adaptation for Critical Infrastructure (RA2CE). Copyright (C) 2023 Stichting Deltares This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- class TrafficIntensitiesReader(link_id)[source]#
Bases:
LossesInputDataReaderBaseClass to read the traffic intensities per traffic period from a csv file.
- Parameters:
link_id (str)
-
csv_columns:
list[str] = []#
- object_type#
alias of
TrafficIntensities
- read(file_path)[source]#
Reads from a given file and converts the data into Any type.
- Return type:
- Parameters:
file_path (Path | None)
- Args:
file_path (Path): Path to a file containing data to be read.
- Returns:
Any: Object mapped from the data in the file.
-
separator:
str= ','#