EventArbitraryProd#

class EventArbitraryProd(*, impact, recovery_tau=1, recovery_function='linear', name=None, occurrence=1, duration=1)[source]#

Bases: Event

An EventArbitraryProd object holds an event with arbitrary impact on production capacity.

Such events can be used to represent temporary loss of production capacity in a completely exogenous way (e.g., loss of working hours from a heatwave).

Warning

This type of event suffers from a problem with the recovery and does not function properly at the moment.

Note

For this type of event, the impact value represent the share of production capacity lost of an industry.

Note

In addition to the base arguments of an Event, EventArbitraryProd requires a recovery_tau (1 step by default) and a recovery_function (linear by default).

See also

Tutorial How to define Events

Methods

__init__(*, impact[, recovery_tau, ...])

distribute_impact_industries(impact, ...[, ...])

from_scalar_regions_sectors(impact, *, ...)

Creates an Event from a scalar, a list of regions and a list of sectors affected.

Attributes

aff_industries

The industries affected by the event.

aff_regions

The array of regions affected by the event

aff_sectors

The array of affected sectors by the event

duration

The duration of the event.

impact

A pandas Series with all possible industries as index, holding the impact vector of the event.

impact_industries_distrib

The series specifying how damages are distributed among affected industries (regions,sectors)

impact_regional_distrib

The series specifying how damages are distributed among affected regions

occurrence

The temporal unit of occurrence of the event.

prod_cap_delta_arbitrary

The optional array storing arbitrary (as in not related to productive_capital destroyed) production capacity loss

recovery_function

The recovery function used for recovery (Callable)

recovery_tau

The characteristic recovery duration after the event is over

name

An identifying name for the event (for convenience mostly)

event_dict

Store relevant information about the event

property aff_industries#

The industries affected by the event.

property aff_regions#

The array of regions affected by the event

property aff_sectors#

The array of affected sectors by the event

property duration#

The duration of the event.

classmethod from_scalar_regions_sectors(impact, *, regions, sectors, impact_regional_distrib=None, impact_sectoral_distrib=None, occurrence=1, duration=1, name=None, **kwargs)#

Creates an Event from a scalar, a list of regions and a list of sectors affected.

Parameters:
impactScalarImpact

The scalar impact.

regionsRegionsList

The list of regions affected.

sectorsSectorsList

The list of sectors affected in each region.

impact_regional_distribOptional[npt.ArrayLike], optional

A vector of equal size to the list of regions affected, stating the share of the impact each industry should receive. Defaults to None.

impact_sectoral_distribOptional[Union[str, npt.ArrayLike]], optional

Either:

  • "gdp", the impact is then distributed using the gross value added of each sector as a weight.

  • A vector of equal size to the list of sectors affected, stating the share of the impact each industry should receive. Defaults to None.

occurrenceint, optional

The ordinal of occurrence of the event (requires to be > 0). Defaults to 1.

durationint, optional

The duration of the event (entire impact applied during this number of steps). Defaults to 1.

nameOptional[str], optional

A possible name for the event, for convenience. Defaults to None.

**kwargs

Keyword arguments Other keyword arguments to pass to the instantiate method (depends on the type of event)

Returns:
Event

An Event object or one of its subclass.

Raises:
ValueError

Raise if Impact is null, if len(regions) or len(sectors) < 1,

property impact#

A pandas Series with all possible industries as index, holding the impact vector of the event. The impact is defined for each sectors in each region.

property impact_industries_distrib#

The series specifying how damages are distributed among affected industries (regions,sectors)

property impact_regional_distrib#

The series specifying how damages are distributed among affected regions

property occurrence#

The temporal unit of occurrence of the event.

name#

An identifying name for the event (for convenience mostly)

event_dict#

Store relevant information about the event

property recovery_tau#

The characteristic recovery duration after the event is over

property prod_cap_delta_arbitrary#

The optional array storing arbitrary (as in not related to productive_capital destroyed) production capacity loss

property recovery_function#

The recovery function used for recovery (Callable)