Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug report: (most.build_model = false; most.solve_model = true) #6

@lordleoo

Description

@lordleoo

If you happen to build your own MOST model, or modify an existing model to add new constraints, new variables and new costs, you'd want MOST to solve the model which you provided, and not build a new model. However, MOST.m has a little bug that prevents that.

line 359 of MOST.m has this if statement:
if mpopt.most.build_model
.
.
.
line 553: om = opt_model
< the remaining some-1000 lines >
end

There is no "ELSE" statement.
the OPT_MODEL was declared the first time inside the if-statement. if for some-reason the program didn't enter this IF statement, then an OM=OPT_MODEL does not exist.
you can not pass an existing (readily built) OM to MOST. The input arguments to MOST are: (MDI) and (MPOPT).

Therefore, there is no way to make use of your modified OM model.
The combination: most.build_model = false; most.solve_model = true would throw an error.

The work around is simple though, right before the end of this if-statement, add a single line:
.
.
.
else; om = mdi.om;
end

this implies that you provided your OM model as a field in the input MDI

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions