tags_relationships#

Module defines constraints that relate variables on the optimization problem.

Example of important tag relationships:

  • cfix and antracito

  • Calcário and basicidade

wip.files.tags_relationships.add_relationship_cfix_antracito(cfix_lpvar: LpVariable, antracito_lpvar: LpVariable, prob: LpProblem, scalers: Dict[str, MinMaxScaler]) LpProblem[source]#

Add constraint to bind cfix and antracito variables on the optimization problem.

The relationship between cfix and antracito is given by the following equation:

antracito = \frac{cfix \times 1.07}{0.072}

This function adds this constraint to the optimization problem, named as "cfix_antracito_relationship".

This function requires the input of the "scalers" dictionary, because the antracito variable is normalized.

Parameters
  • cfix_lpvar (pulp.LpVariable) – Variable that represents the cfix (“carbono fixo”) variable on the optimization problem.

  • antracito_lpvar (pulp.LpVariable) – Variable that represents the antracito variable on the optimization problem.

  • prob (pulp.LpProblem) – Optimization problem instance.

  • scalers (Dict[str, MinMaxScaler]) – Dictionary mapping variable names to corresponding MinMaxScaler instances that were used for normalizing them.

Returns

Optimization problem instance with the constraint "cfix_antracito_relationship" added.

Return type

pulp.LpProblem

Notes

Instead of defining the relationship between cfix and antracito

Changed in version 1.2.1: Made changes to the numerator of the equation from 1.07 to 1.12.