Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip fixing inputs in sequential decomposition #3442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading