Skip to content

Commit

Permalink
count failing regions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Sep 6, 2023
1 parent 376c8f7 commit 297af22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/80_optimization/nash/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ p80_repy_iteration(all_regi,solveinfo80,iteration) "summary report from solver i
p80_repyLastOptim(all_regi,solveinfo80) "p80_repy from last iteration"
p80_messageFailedMarket(tall,all_enty) "nash display helper"
p80_messageShow(convMessage80) "nash display helper"
p80_trackConsecFail(all_regi) "Parameter to keep track of consecutive solve failurs of regions in Nash mode."
p80_trackConsecFail(all_regi) "Parameter to keep track of consecutive solve failures of regions in Nash mode."

p80_curracc(ttot,all_regi) "current account"

Expand Down
5 changes: 3 additions & 2 deletions modules/80_optimization/nash/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,11 @@ if(cm_abortOnConsecFail, !! execute only if consecutive failures switch is non-z
else
p80_trackConsecFail(regi) = p80_trackConsecFail(regi) + 1;
);

);
loop(regi,
if(p80_trackConsecFail(regi) >= cm_abortOnConsecFail,
execute_unload "abort.gdx";

display p80_trackConsecFail;
abort "Run was aborted because the maximum number of consecutive failures was reached in at least one region!";
);
)
Expand Down

0 comments on commit 297af22

Please sign in to comment.