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

Removed the initialize argument #40

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Removed the initialize argument #40

merged 2 commits into from
Aug 15, 2024

Conversation

AlbertLee125
Copy link
Member

The bigM has the initialize argument
resulting me to initialize a Suffix with an integer value, which is not iterable.
I tried to resolve the issue BigM: TypeError: 'int' object is not iterable #31 by removing the initialize parameter.

#31

@ZedongPeng
Copy link
Member

Removing the initial value for bigM might not be a good option. Can we try something else? @AlbertLee125

@AlbertLee125
Copy link
Member Author

m.bigM = Suffix(direction=Suffix.LOCAL, initialize=7000)

The initial parameter for a Suffix object in Pyomo expects a dictionary or a callable (such as a function) that maps components to values. It does not accept a single integer value.
It would be better to remove or modify the benchmark.py.

TransformationFactory('gdp.bigm').apply_to(m, bigM=7000)

@bernalde
Copy link
Member

Please check how the BigM parameter is initialized in the examples from the Pyomo repo and implement it that way.
Also, make sure that the tests pass before requesting for review

@ZedongPeng
Copy link
Member

@@ -52,7 +52,7 @@ def build_model():
[2] Chen, Q., & Grossmann, I. E. (2019). Effective generalized disjunctive programming models for modular process synthesis. Industrial & Engineering Chemistry Research, 58(15), 5873-5886. https://doi.org/10.1021/acs.iecr.8b04600
"""
m = ConcreteModel('Biofuel processing network')
m.bigM = Suffix(direction=Suffix.LOCAL, initialize=7000)
m.bigM = Suffix(direction=Suffix.LOCAL)#, initialize=7000) # Removed the initialize argument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to provide the same initial guess for the Big-M parameter here

@AlbertLee125
Copy link
Member Author

Testing the model by running it. The error has been resolved.

@bernalde bernalde merged commit 3d803d8 into master Aug 15, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants