Package development log

Flowchart for the implementation.

Overview

The core functionalities contain the following steps:

  • provide food data
  • compute inequality constraints (based on current total contribution from the existing diet)
  • algorithm to find the new diet
  • result processing and presentation

The existing implementation is fixed: not functionalized. The target implementation should allow flexibility at each step.

Provide food data

Compute inequality constraints

The default inequality constraints are based on the current total contribution:

  • current diet (d)
  • contrib per unit for each target outcome (e.g. ghge, energy)
  • option to scale / standardize

Inequality constraints depend on the above, plus the coefficients to set upper and lower. Probably a good idea to split upper and lower.

Optimization algorithm

This step requires better functional programming: need to wrap the functions to generate multiple inequality formulae.

Output processing