FragilityCurve#

module wntr.scenario.fragility_curve

class FragilityCurve[source]#

Bases: object

Fragility Curve class.


__init__()[source]#
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

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 – Probability of exceeding a damage state

Return type:

pd.Dataframe

get_priority_map()[source]#

Returns a dictonary of state name and priority number.

sample_damage_state(Pr, seed=None)[source]#

Sample the damage state using a uniform random variable

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

  • seed (int or None) – Random seed

Returns:

damage_state – The damage state of each element

Return type:

pd.Series

states()[source]#

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

Return type:

state_name, state