Created
March 1, 2016 11:31
-
-
Save gidden/df1d8a724bb48db62075 to your computer and use it in GitHub Desktop.
pyomo wrong guess_format()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/work/pyomo/pyomo$ svn up | |
Updating '.': | |
At revision 11187. | |
~/work/pyomo/pyomo$ cd ~/tmp | |
~/tmp$ python write.py | |
~/tmp$ diff modelb.mps model.lp # no difference, same file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyomo.environ import * | |
from pyomo.opt import ProblemFormat | |
def create_model(): | |
model = ConcreteModel() | |
model.x = Var() | |
model.o = Objective(expr=model.x) | |
model.c = Constraint(expr=model.x >= 1) | |
model.x.set_value(1.0) | |
return model | |
model = create_model() | |
model.write('modela.mps', format=ProblemFormat.mps) | |
model.write('modelb.mps') | |
model.write('model.lp', format=ProblemFormat.cpxlp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment