citylearn.power_outage module

class citylearn.power_outage.PowerOutage(random_seed: int = None)[source]

Bases: object

Base stochastic power outage model class.

Randomly assigns power outage signal to time steps.

Parameters:

random_seed (int, optional) – Pseudorandom number generator seed for repeatable results.

get_signals(time_steps: int, **kwargs) ndarray[source]

Returns power outage signal time series.

Returns time series with randomly selected time steps set as candidates for power outage.

Parameters:
  • time_steps (int) – Number of time steps in returned signal time series.

  • kwargs (Any) – Any other parameters specific to get_signals() method for other subclasses of citylearn.grid_resilience.PowerOutage.

Returns:

signals – Power outage time series signal where value of 0 indicates no power outage at time step index whereas value of 1 indicates a power outage at said time step.

Return type:

np.ndarray

property random_seed: int
class citylearn.power_outage.ReliabilityMetricsPowerOutage(saifi: float = None, caidi: float = None, start_time_steps: List[int] = None, **kwargs)[source]

Bases: PowerOutage

Power outage signal stochastic model based on Distribution System Reliability Metrics.

Generates time series of power outage signals based on System Average Interruption Frequency Index (SAIFI) and Customer Average Interruption Duration Index (CAIDI). The signal is generated by sampling n instances from a binomial distribution to select days that experience power outage where the probability, p, is the ratio of saifi to number of days in a year (365). The start time step index for the outage on each day is then randomly selected from a uniform distribution of start_time_steps or all valid daily time step indexes. Finally the duration of each power outage event is set by sampling from an exponential distribution with a scale set to caidi.

Parameters:
  • saifi (float, default: 1.436) – Number of non-momentary electric interruptions, per year, the average customer experienced and is used as the average number of days per year that experience power outage.

  • caidi (float, default: 331.2) – Average number of minutes it takes to restore non-momentary electric interruptions and is used as the average length of a power outage.

  • start_time_steps (List[int], optional) – List of candidate daily time step indexes to randomly select from when deciding start time step of an outage. For example, for an hourly simulation that wants to consider power outages that start during the evening peak between 4 PM to 7 PM will set start_time_steps as [15, 16, 17, 18]. By default all daily time step indexes are considered.

  • **kwargs (dict) – Other keyword arguments used to initialize citylearn.grid_resilience.PowerOutage super class.

Notes

The reliability metrics are sourced from https://www.eia.gov/electricity/annual/html/epa_11_01.html.

property caidi: float
get_signals(time_steps: int, seconds_per_time_step: float, **kwargs) ndarray[source]

Returns power outage signal time series.

Returns time series with randomly selected time steps set as candidates for power outage.

Parameters:
  • time_steps (int) – Number of time steps in returned signal time series.

  • seconds_per_time_step (float) – Number of seconds in one time_step.

  • kwargs (Any) – Any other parameters specific to get_signals() method for other subclasses of citylearn.grid_resilience.PowerOutage.

Returns:

signals – Power outage time series signal where value of 0 indicates no power outage at time step index whereas value of 1 indicates a power outage at said time step.

Return type:

np.ndarray

property saifi: float
property start_time_steps: List[int]