Skip to content

Commit

Permalink
add skip_fixing_inputs option
Browse files Browse the repository at this point in the history
  • Loading branch information
alma-walmsley committed Dec 5, 2024
1 parent eb8a6b5 commit 4411891
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyomo/network/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ class SequentialDecomposition(FOQUSGraph):
Keyword options to pass to solve method.
`default={}`
skip_fixing_inputs: `bool`
Skip fixing all the variables on the tear ports. Require the user
to fix the port variables so that 0 degrees of freedom are
maintained.
`default=False`
"""

def __init__(self, **kwds):
Expand All @@ -176,6 +183,7 @@ def __init__(self, **kwds):
options["tear_solver"] = "cplex"
options["tear_solver_io"] = None
options["tear_solver_options"] = {}
options["skip_fixing_inputs"] = False

options.update(kwds)

Expand Down Expand Up @@ -390,6 +398,7 @@ def run_order(self, G, order, function, ignore=None, use_guesses=False):
arc_map = self.arc_to_edge(G)
guesses = self.options["guesses"]
default = self.options["default_guess"]
skip_fixing_inputs = self.options["skip_fixing_inputs"]
for lev in order:
for unit in lev:
if unit not in fixed_inputs:
Expand All @@ -402,7 +411,8 @@ def run_order(self, G, order, function, ignore=None, use_guesses=False):
continue
if use_guesses and port in guesses:
self.load_guesses(guesses, port, fixed_ins)
self.load_values(port, default, fixed_ins, use_guesses)
if not skip_fixing_inputs:
self.load_values(port, default, fixed_ins, use_guesses)

function(unit)

Expand Down

0 comments on commit 4411891

Please sign in to comment.