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 packaget (
float
) – Year in which to apply spending adjustmentsprog_names (
list
) – List of program names to include in this packageinitial_spends (
array
) – Array of spending values for each program, same length as prog_namesmin_props (
list
) – (optional) List of minimum proportion to spend on each program, same length asprog_names
. Default: 0 for all programsmax_props (
list
) – (optional) List of maximum proportion to spend on each program, same length asprog_names
. Default: 1 for all programsmin_total_spend (
float
) – (optional) Minimum total spend. Default: equal to the sum of the initial spendsmax_total_spend (
float
) – (optional) Maximum total spend. Default: equal to the sum of the initial spendsfix_props (
bool
) – (optional) If True, do not allow initial spending proportion to change
Attributes
Returns True if the total spend on this package can be optimized :return:
fix_props
A list of
Adjustables
Methods
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 :return:
- adjustables¶
A list of
Adjustables
- get_initialization(progset, instructions)¶
Return initial values for ASD
- Parameters:
progset (
ProgramSet
) – TheProgramSet
being used for the optimizationinstructions (
ProgramInstructions
) – The initial instructions
- Return type:
- Returns:
A list of initial values, one for each adjustable