atomica.optimization.SpendingPackageAdjustment

class atomica.optimization.SpendingPackageAdjustment(package_name, t, prog_names, initial_spends, min_props=None, max_props=None, min_total_spend=None, max_total_spend=None, fix_props=False)[source]

Bases: Adjustment

Adjustment to set total spending on several programs

This adjustment can be used when it is important to constrain the sum of spending on multiple programs. For example, a package could be defined for ‘MDR short’ and ‘MDR standard’ standard programs, where the adjustments would be the total spend on MDR, and the fraction spent on MDR short.

By default, the total spend on the package is constrained. In practice, it would usual to either
  • Fix the proportions of the programs within the package

OR - Fix the total spend on the package

Although a less common usage would be to constrain the ratio of the programs within the package (e.g., program B must have no more than half the funding of program A).

Essentially, if none of min_props, max_props, min_total_spend or max_total_spend are specified, the SpendingPackageAdjustment should function the same as simply optimizing each intervention independently.

Parameters
  • package_name (str) – The name of this spending package

  • t (float) – Year in which to apply spending adjustments

  • prog_names (list) – List of program names to include in this package

  • initial_spends (array) – Array of spending values for each program, same length as prog_names

  • min_props (Optional[list]) – (optional) List of minimum proportion to spend on each program, same length as prog_names. Default: 0 for all programs

  • max_props (Optional[list]) – (optional) List of maximum proportion to spend on each program, same length as prog_names. Default: 1 for all programs

  • min_total_spend (Optional[float]) – (optional) Minimum total spend. Default: equal to the sum of the initial spends

  • max_total_spend (Optional[float]) – (optional) Maximum total spend. Default: equal to the sum of the initial spends

  • fix_props (bool) – (optional) If True, do not allow initial spending proportion to change

Attributes

adjust_total_spend

Returns True if the total spend on this package can be optimized :rtype: bool :return:

fix_props

rtype

bool

Methods

get_initialization

Return initial values for ASD

get_total_spend

set_total_spend

update_instructions

property adjust_total_spend: bool

Returns True if the total spend on this package can be optimized :rtype: bool :return:

adjustables

A list of Adjustables

get_initialization(progset, instructions)

Return initial values for ASD

Parameters
Return type

list

Returns

A list of initial values, one for each adjustable