Skip to content

Commit

Permalink
Bug fix : solve error which was returned when optimal integer solutio…
Browse files Browse the repository at this point in the history
…n was found during the relaxed iterations
  • Loading branch information
baptsegu committed May 4, 2017
1 parent fdc5ffa commit 4503644
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions R/benders.R
Original file line number Diff line number Diff line change
Expand Up @@ -347,23 +347,23 @@ benders <- function(path_solver, display = TRUE, report = TRUE, opts = simOption
{
has_converged <- TRUE
}

# if master problem solution didn't evolve at this (full) iteration, then the decomposition has
# converged

if(all(abs(benders_sol - x$invested_capacities[[current_it$id]]) <= 0.1) )
{
if(current_it$full)
{
has_converged <- TRUE
}
else
{
current_it$need_full <- TRUE
}
}
}

# if master problem solution didn't evolve at this (full) iteration, then the decomposition has
# converged

if(all(abs(benders_sol - x$invested_capacities[[current_it$id]]) <= 0.1) )
{
if(current_it$full)
{
has_converged <- TRUE
}
else
{
current_it$need_full <- TRUE
}
}

# if option integer has been chosen and integer has not yet been used, convergence cannot be reached
if(exp_options$master == "integer" && relax_integrality)
{
Expand Down

0 comments on commit 4503644

Please sign in to comment.