linopy.variables.Variables.fix

Contents

linopy.variables.Variables.fix#

Variables.fix(value=None, decimals=8, overwrite=True)#

Fix all variables in this container to their solution or a scalar value.

Delegates to each variable’s fix() method. See Variable.fix() for details.

Parameters:
  • value (int/float, optional) – Scalar value to fix all variables to. Only scalar values are accepted to avoid shape mismatches across differently-shaped variables. If None, each variable is fixed to its current solution.

  • decimals (int, optional) – Number of decimal places to round continuous variables to.

  • overwrite (bool, optional) – If True, overwrite existing fix constraints.