wntr.scenario.fragility_curve module

The wntr.scenario.fragility_curve module includes methods to define damage states and priority and return the probability of damage based on a control variable.

class wntr.scenario.fragility_curve.FragilityCurve[source]

Bases: object

Fragility Curve class.

add_state(name, priority=0, distribution={})[source]

Add a damage state distribution

Parameters
  • name (string) – Name of the damage state

  • priority (int) – Damage state priority

  • distribution (dict, key = string, value = scipy.stats statistical function) – ‘Default’ can be used to specificy all location

states()[source]

A generator to iterate over all states, in order of priority

Returns

state_name, state

get_priority_map()[source]

Returns a dictonary of state name and priority number.

cdf_probability(x)[source]

Return the CDF probability for each state, based on the value of x

Parameters

x (pd.Series) – Control variable for each element

Returns

Pr (pd.Dataframe) – Probability of exceeding a damage state

sample_damage_state(Pr)[source]

Sample the damage state using a uniform random variable

Parameters

Pr (pd.Dataframe) – Probability of exceeding a damage state

Returns

damage_state (pd.Series) – The damage state of each element