simdesign.rcmrf.bcim.randomization
This module provides samplers for randomization in the building portfolio generation process.
- class simdesign.rcmrf.bcim.randomization.Sampler(num_sample, seed=None)[source]
Bases:
objectSampler for regular moment resisting frame structures.
- Variables:
sample_size (int) – Number of samples to be generated.
staircase_span_length_x (np.ndarray) – Staircase span length in X direction.
typical_span_length_x (np.ndarray) – Typical span length in X direction.
typical_span_length_y (np.ndarray) – Typical span length in Y direction.
layout (np.ndarray) – Building floor layouts.
typical_storey_height (np.ndarray) – Typical storey heights.
ground_storey_height (np.ndarray) – Ground storey heights.
slab_type (np.ndarray) – Slab typology. 1: Two-way solid slab. 2: One-way solid slab. 3: One-way composite slab with ceramic blocks and RC joists or pre-stressed beams.
beam_type (np.ndarray) – Beam typology. 1: Wide beams. 2: Emergent beams.
column_section (np.ndarray) – Column cross-section. 1: Square solid section. 2: Rectangular solid section.
steel_grade (np.ndarray) – Steel material class ID, e.g., ‘S400’.
concrete_grade (np.ndarray) – Concrete material class ID, e.g., ‘C20/25’.
quality (np.ndarray) – Construction quality. 1: High quality. 2: Moderate quality. 3: Low quality.
ext_infill_type (np.ndarray) – Exterior masonry infill typology in terms of strength. 1: Weak. 2: Medium. 3: Strong.
int_infill_type (np.ndarray) – Interior masonry infill typology in terms of strength. 1: Weak. 2: Medium. 3: Strong.
infill_conf (np.ndarray) – Masonry infill wall configuration IDs. 1: Exterior only, Regular over the height, XX + YY. 2: Exterior only, Pilotis, XX + YY. 3: Exterior only, Pilotis, XX. 4: Exterior only, Pilotis, YY. 5: Exterior + Interior, Regular over the height, XX + YY. 6: Exterior + Interior, Pilotis, XX + YY. 7: Exterior + Interior, Pilotis, XX. 8: Exterior + Interior, Pilotis, YY. 9: Interior only, Regular over the height, XX + YY. 10: Interior only, Pilotis, XX + YY. 11: Interior only, Pilotis, XX. 12: Interior only, Pilotis, YY.
- Parameters:
num_sample (int)
seed (int | None)
- staircase_span_length_x: ndarray
- typical_span_length_x: ndarray
- typical_span_length_y: ndarray
- layout: ndarray
- typical_storey_height: ndarray
- ground_storey_height: ndarray
- slab_type: ndarray
- beam_type: ndarray
- column_section: ndarray
- steel_grade: ndarray
- concrete_grade: ndarray
- quality: ndarray
- ext_infill_type: ndarray
- int_infill_type: ndarray
- infill_conf: ndarray
- sample_size: int
- set_stair_span_length_x(lower_bound, upper_bound)[source]
Set staircase span lengths.
Staircase span lengths are represented by uniform distribution.
- Parameters:
lower_bound (float) – Lower boundary of the output interval. All values generated will be greater than or equal to lower bound.
upper_bound (float) – Upper boundary of the output interval. All values generated will be less than or equal to upper bound.
- Returns:
Staircase span lengths.
- Return type:
List[float]
Examples
>>> lower_bound = 2.8 >>> upper_bound = 3.2
- set_typical_span_length(corr_coeff, lower_bound, upper_bound, theta, std_ln)[source]
Set typical span lengths in x and Y directions.
Typical span lengths are represented with truncated log-normal distribution. It is assumed that span lengths are correlated. The samples are generated from multivariate truncated lognormal distribution.
- Parameters:
corr_coeff (float) – Correlation coefficient (between span lengths x and y).
lower_bound (Tuple[float]) – Lower bound for truncated log-normal distribution (x, y).
upper_bound (Tuple[float]) – Upper bound for truncated log-normal distribution (x, y).
theta (Tuple[float]) – Median of log-normal distribution.
std_ln (Tuple[float]) – Logarithmic standard deviation of the log-normal distribution (x, y).
- Return type:
Tuple[List[float]]
Notes
~LN(ln(theta), sigma)
- Returns:
Span lengths (x, y).
- Return type:
Tuple[List[float]]
- Parameters:
corr_coeff (float)
lower_bound (Tuple[float])
upper_bound (Tuple[float])
theta (Tuple[float])
std_ln (Tuple[float])
Examples
>>> corr_coeff = -0.92 >>> lower_bound = (3.5, 3.5) >>> upper_bound = (7.5, 6.0) >>> theta = (4.5, 4.5) >>> std_ln = (0.35, 0.35)
- set_layout(layouts)[source]
Set plan layout IDs for buildings.
- Parameters:
layouts (List[str]) – Building layouts.
- Returns:
Random building layout assignments.
- Return type:
List[str]
Examples
>>> layouts = ["B01", "B02", "B03", "B04", "B04b", ... "B05", "B06", "B07", "B08", "B09", "B10"]
- set_typical_storey_height(cv, mu, lower_bound, upper_bound)[source]
Set typical storey heights.
Typical storey heights are represented with truncated log-normal distribution.
- Parameters:
cv (float) – Coefficient of variation, s/mu.
mu (float) – Mean of normal distribution.
lower_bound (float) – Lower bound of truncated log-normal distribution.
upper_bound (float) – Upper bound of truncated log-normal distribution.
- Returns:
Generated typical storey heights.
- Return type:
List[float]
Examples
>>> cv = 0.07 >>> mu = 2.90 >>> lower_bound = 2.3 >>> upper_bound = 3.8
- set_ground_storey_height(factors, probabilities, max_height)[source]
Set ground storey heights.
- Parameters:
factors (List[float]) – Factors applied on typical storey heights to obtain ground storey heights.
probabilities (List[float]) – Corresponding probabilities of factors.
max_height (float) – Maximum considered ground storey height.
- Returns:
Randomised ground storey heights.
- Return type:
List[float]
Notes
1. ground_storey_height = min(factor * typical_storey_heights, max_height) 2. Factors have different probabilities.
Examples
>>> factors = [1.0, 1.1, 1.2, 1.3, 1.4] >>> probability = [0.55, 0.10, 0.20, 0.10, 0.05] >>> max_height = 4.20
- set_slab_type(ss1_prob_given_ss1_or_hs, ss2_prob_given_ss2_or_hs, max_ss_short_span, max_ss2_aspect_ratio)[source]
Set slab typology following a span length based decision tree.
- Parameters:
ss1_prob_given_ss1_or_hs (float) – Probability of having SS1 type slab given that the slab type is either SS1 or HS.
ss2_prob_given_ss2_or_hs (float) – Probability of having SS2 type slab given that the slab type is either SS2 or HS.
max_ss_short_span (float) – Upper limit for the shorter span length in solid slabs (SS1, SS2).
max_ss2_aspect_ratio (float) – Upper limit for the ratio of maximum to minimum span lengths (aspect ratio) in SS2 slabs.
- Returns:
Slab typologies.
- Return type:
List[Literal[1, 2, 3]]
Notes
1. Slab typologies: Solid two-way cast-in-situ slabs (1: SS2), Solid one-way cast-in-situ slabs (2: SS1), Composite slabs with pre-fabricated joists and ceramic blocks (3: HS). 2. Slab type is assigned as HS, if minimum span length is greater than the upper limit for minimum solid slab span length (minimum span length <= max_ss_short_span). 3. Otherwise, if the ratio of maximum to minimum span lengths is greater or equal to max_ss2_aspect_ratio, slab type is randomly as SS1 or HS based on ss1_prob_given_ss1_or_hs. 4. Otherwise, slab type is determined randomly as SS2 or HS based on ss2_prob_given_ss2_or_hs.
Examples
>>> ss1_prob_given_ss1_or_hs = 0.50 >>> ss2_prob_given_ss2_or_hs = 0.65 >>> max_ss_short_span = 6.0 # in meters >>> max_ss2_aspect_ratio = 2.0
- set_beam_type(wb_prob_given_hs)[source]
Set beam types.
- Parameters:
wb_prob_given_hs (float) – Probability of having wide beams (WB) given slab type is HS.
- Returns:
Beam typologies.
- Return type:
List[Literal[1, 2]]
Notes
If slabs are solid slabs, beams are set as emergent beams (2).
Otherwise, randomly assign wide (1) or emergent beam (2) based on the user-defined wb_prob_given_hs parameter.
Examples
>>> wb_prob_given_hs = 0.50
- set_column_type(square_prob)[source]
Set the type of column or cross-section geometry.
- Parameters:
square_prob (float) – Probability of having square columns.
- Returns:
Randomly assigned column types for each building, square (1) or rectangular (2).
- Return type:
List[Literal[1, 2]]
Examples
>>> square_prob = 0.50
- set_material_class(material_class, probability, material)[source]
Randomly assign material classes to buildings given their occurrence probabilities.
- Parameters:
material_class (List[str]) – List of defined material classes.
probability (List[float]) – Probabilities of having different material classes. Sum should be equal to 1.0.
material (Literal["steel", "concrete"]) – Type of material, which can be either “steel” or “concrete”.
- Returns:
Randomly assigned material classes for building.
- Return type:
List[str]
Examples
>>> material_class = ["S240", "S400"] >>> probabilities = [0.60, 0.40]
- set_construction_quality(quality_ids, probabilities)[source]
Set construction quality in a randomised fashion.
- Parameters:
quality_ids (List[int]) – Quality identifiers, IDs.
probabilities (List[float]) – Corresponding probabilities for construction qualities. Sum should be equal to 1.0.
- Returns:
Construction quality sample.
- Return type:
List[int]
Examples
>>> quality_ids = [1, 2, 3] >>> probabilities = [0.6, 0.3, 0.1]
- set_ext_infill_type(infill_types, probabilities)[source]
Set masonry exterior infill wall typologies in a randomised fashion.
- Parameters:
infill_types (List[int]) – Infill typology IDs.
probabilities (List[float]) – Corresponding probabilities for infill typologies. Sum should be equal to 1.0.
- Returns:
Exterior masonry infill typology sample.
- Return type:
List[int]
Examples
>>> infill_types = [1, 2, 3] >>> probabilities = [0.6, 0.3, 0.1]
- set_int_infill_type(infill_types, probabilities)[source]
Set masonry interior infill wall typologies in a randomised fashion.
- Parameters:
infill_types (List[int]) – Infill typology IDs.
probabilities (List[float]) – Corresponding probabilities for infill typologies. Sum should be equal to 1.0.
- Returns:
Interior masonry infill typology sample.
- Return type:
List[int]
Notes
It is assumed that interior infills should be weaker than exterior ones, if they co-exist.
Examples
>>> infill_types = [1, 2, 3] >>> probabilities = [0.33, 0.34, 0.33]
- set_infill_conf(infill_confs, probabilities)[source]
Set masonry infill wall configurations in a randomised fashion.
- Parameters:
infill_confs (List[int]) – Infill configuration IDs.
probabilities (List[float]) – Corresponding probabilities for infill configuration IDs. Sum should be equal to 1.0.
- Returns:
Masonry infill configuration sample.
- Return type:
List[int]
Examples
>>> infill_confs = [1, 2, 5, 6] >>> probabilities = [0.25, 0.25, 0.25, 0.25]