distributions package#
Submodules#
distributions.custom_building_distribution module#
- class distributions.custom_building_distribution.CustomBuildingDistribution#
Bases:
TimeSpaceDistribution
Custom Building Scenario
Choose your own distirbution and parameters for experiments.
distributions.distribution module#
- class distributions.distribution.EqualFloorDistribution(amount_floors: int)#
Bases:
FloorDistribution
A distribution with equal probability for every floor.
- Parameters:
amount_floors (int) – The amount of floors.
- class distributions.distribution.FloorDistribution(distribution: list)#
Bases:
object
A distribution of how many passengers per floor at a fixed time point.
- Parameters:
distribution (list(float)) – A list of probabilities for every floor.
- get_index_prob(index)#
Returns the probability of the given floor index.
- Parameters:
index (int) – The index of the floor.
- Returns:
The probability of the given floor index.
- Return type:
float
- get_random_index(exclude=None)#
Returns a random floor index based on the distribution.
- Parameters:
exclude (int) – The index to exclude from the distribution.
- is_chosen(index)#
- update_distribution(distribution)#
Updates the distribution of the floor distribution.
- Parameters:
distribution (list(float)) – A list of probabilities for every floor.
- class distributions.distribution.PeakFloorDistribution(amount_floors: int, peak_floor: int, multiplier: int)#
Bases:
FloorDistribution
A distribution with a peak probability for a specific floor.
- class distributions.distribution.TimeDistribution(time_type, max_time_typed, data)#
Bases:
object
A probability distribution of how many passengers spawn on a floor over time.
- Parameters:
time_type – The type of the time values. Can be “s”, “m” or “h”.
max_time_typed – The maximum time in the given time type.
data (list(tuple(int, float))) – A list of tuples (time, probability).
- add_data(data)#
Adds data to the distribution.
- Parameters:
data (list(tuple(int, float))) – A list of tuples (time, probability).
- get_interpolated_prob(time)#
Get the interpolated probability for the given time.
- Parameters:
time (int) – The time to get the probability for.
- Returns:
The interpolated probability for the given time.
- Return type:
float
- precompute_interpolated_probs()#
Precomputes the interpolated probabilities for every time point to improve performance.
- class distributions.distribution.TimeSpaceDistribution(max_passengers, time_type, max_time_typed, data, passenger_distribution, distribution_name='Base distribution')#
Bases:
object
A distribution of how many passengers spawn on every floor over time. max_passengers: The maximum amount of passengers that can spawn in the entire building once. time_type: The type of the time values. Can be
"s", "m" or "h"
. data: A list of tuples (time, spawnDistribution, target_distribution) with the last two parameters being a Distribution object. passenger_distribution: A TimeDistribution object that determines how many passengers spawn in the building at a given time.Note: The spawnDistribution and target_distribution of the data parameter contain the probabilities of which floor should be chosen for spawning or as a target.
- Parameters:
max_passengers (int) – The maximum amount of passengers that can spawn in the entire building once.
time_type – The type of the time values. Can be
"s", "m" or "h"
.
- get_floor_distributions(time)#
Returns a list of tuples (spawnDistribution, target_distribution) of the passengers that spawn at the given time.
- Parameters:
time (int) – The time to get the passengers for.
- Returns:
A list of tuples (spawnDistribution, target_distribution) of the passengers that spawn at the given time.
- Return type:
list(tuple(FloorDistribution, FloorDistribution))
- get_passenger_amount(time)#
Returns a double amount of the passengers that spawn at the given time.
- Parameters:
time (int) – The time to get the passengers for.
- Returns:
A double amount of the passengers that spawn at the given time.
- Return type:
double
- get_passengers_to_spawn(time)#
Returns a list of tuples (spawnFloor, target_floor) of the passengers that spawn at the given time.
- Parameters:
time (int) – The time to get the passengers for.
- Returns:
A list of tuples (spawnFloor, target_floor) of the passengers that spawn at the given time.
- Return type:
list(tuple(int, int))
- get_spawn_amount(time)#
Returns an integer amount of passengers that spawn at the given time using the exponential distribution.
- Parameters:
time (int) – The time to get the passengers for.
- Returns:
An integer amount of passengers that spawn at the given time using the exponential distribution.
- Return type:
int
distributions.high_density_distribution module#
- class distributions.high_density_distribution.HighDensityDistribution#
Bases:
TimeSpaceDistribution
High Density Distribution Scenario
Equal start and target distribution for the whole day. High amount of passengers
distributions.low_density_distribution module#
- class distributions.low_density_distribution.LowDensityDistribution#
Bases:
TimeSpaceDistribution
Low Density Distribution Scenario
Equal start and target distribution for the whole day. Low amount of passengers
distributions.residential_building_distribution module#
- class distributions.residential_building_distribution.ResidentialBuildingDistribution#
Bases:
TimeSpaceDistribution
Residential Building Scenario
Building constantly has 10x more people entering/exiting than going to other floors.
People exiting (through floor 0):
00:00 - 05:00: Low amount of people exiting the building
05:00 - 06:00: Some people exiting the building (early work)
06:00 - 10:00: Many people exiting the building (work)
10:00 - 12:00: Low amount of people exiting the building
13:00 : Small peak of people exiting the building (lunch)
14:00 - 24:00: Low amount of people exiting the building
People entering (through floor 0):
00:00 - 11:00: Low amount of people entering the building
12:00 : Small peak of people entering the building (lunch)
13:00 - 15:00: Low amount of people entering the building
15:00 - 19:00: Many people entering the building (back from work)
19:00 - 24:00: Low amount of people entering the building
distributions.rooftop_bar_distribution module#
- class distributions.rooftop_bar_distribution.RooftopBarDistribution#
Bases:
TimeSpaceDistribution
Rooftop Bar Scenario
Building is open from 08:00 to 24:00, most people come between 20:00 and 22:00, when the rooftop bar is open.
00:00 - 07:00: Distributed low usage of building
07:00 - 08:00: Distributed increased usage of building
08:00 - 10:00: Distributed medium usage of building
10:00 - 11:00: Rooftop bar opens, people start coming in from the ground floor (3x more people than other floors)
20:00 - 22:00: Rooftop bar peak usage (20x more people than other floors)
23:00 - 24:00: Rooftop bar closes, people start leaving from the top floor
distributions.shopping_mall_distribution module#
- class distributions.shopping_mall_distribution.ShoppingMallDistribution#
Bases:
TimeSpaceDistribution
Shopping Mall Scenario
Shopping mall is open from 08:00 to 21:00, most people come between 10:00 and 18:00, peak at 12:00
00:00 - 08:00: Distributed low usage of building
08:00 - 10:00: Distributed usage of building going up
10:00 - 12:00: Distributed usage gradient to peak
12:00 - 18:00: Distributed usage gradient to normal
18:00 - 24:00: Distributed usage of building going down