change_par#

class change_par(par, years=None, vals=None, verbose=False, **kwargs)[source]#

Bases: Intervention

Change a parameter at a specified point in time.

Parameters:
  • par (str) – the parameter to change

  • years (float/arr) – the year(s) at which to apply the change

  • vals (any) – a value or list of values to change to (if a list, must have the same length as years); or a dict of year:value entries

If any value is 'reset', reset to the original value.

Example:

ec0 = fp.change_par(par='exposure_factor', years=[2000, 2010], vals=[0.0, 2.0]) # Reduce exposure factor
ec0 = fp.change_par(par='exposure_factor', vals={2000:0.0, 2010:2.0}) # Equivalent way of writing
sim = fp.Sim(interventions=ec0).run()

Attributes

has_product

Check if the intervention has a product

now

Shortcut to self.t.now()

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

ti

Get the current module timestep

timevec

Shortcut to self.t.timevec

Methods