Rev | Line | |
---|
[37] | 1 | function done = save_model_expansion(method,F_graph,properties) |
---|
| 2 | global ALREADY_MODELLED REMOVE_THESE_IN_THE_END |
---|
| 3 | |
---|
| 4 | done = 0; |
---|
| 5 | |
---|
| 6 | for variables = properties.models |
---|
| 7 | if length(ALREADY_MODELLED)>=variables & ~isempty(ALREADY_MODELLED{variables}) |
---|
| 8 | % Ouch, we have already modelled this-one |
---|
| 9 | if strcmpi(ALREADY_MODELLED{variables}.method,method) |
---|
| 10 | % Ok, already modelled using same approach |
---|
| 11 | done = 1; |
---|
| 12 | return |
---|
| 13 | elseif strcmpi(ALREADY_MODELLED{variables}.method,'graph') & strcmpi(method,'milp') |
---|
| 14 | % Replace old graph model with MILP model |
---|
| 15 | REMOVE_THESE_IN_THE_END = [REMOVE_THESE_IN_THE_END ALREADY_MODELLED{variables}.index]; |
---|
| 16 | ALREADY_MODELLED{variables}.method = 'milp'; |
---|
| 17 | ALREADY_MODELLED{variables}.index = getlmiid(F_graph); |
---|
| 18 | elseif strcmpi(ALREADY_MODELLED{variables}.method,'milp') & strcmpi(method,'graph') |
---|
| 19 | % Keep old stuff, we are done |
---|
| 20 | done = 1; |
---|
| 21 | return |
---|
| 22 | end |
---|
| 23 | else |
---|
| 24 | ALREADY_MODELLED{variables}.method = method; |
---|
| 25 | ALREADY_MODELLED{variables}.index = getlmiid(F_graph); |
---|
| 26 | end |
---|
| 27 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.