-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix empty optimization result + test of infeasible ip restricted mast…
…er (#173) * fix empty optres get * deactivate & activate art vars; GLPK exception. * does not call solver if 0 vars * add unsafe_getsolutions
- Loading branch information
Showing
12 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function masteripheur_tests() | ||
infeasible_master_ip_heur_tests() | ||
end | ||
|
||
CL.to_be_pruned(n::CL.Node) = true # issue 166 | ||
|
||
struct InfeasibleMasterIpHeur <: CL.AbstractConquerStrategy end | ||
|
||
function CL.apply!(::Type{InfeasibleMasterIpHeur}, reform, node, strategy_rec::CL.StrategyRecord, params) | ||
# Apply directly master ip heuristic => infeasible | ||
mip_rec = CL.apply!(CL.MasterIpHeuristic, reform, node, strategy_rec, params) | ||
return | ||
end | ||
|
||
function infeasible_master_ip_heur_tests() | ||
@testset "play gap" begin | ||
data = CLD.GeneralizedAssignment.data("play2.txt") | ||
|
||
coluna = JuMP.with_optimizer( | ||
Coluna.Optimizer, | ||
params = CL.Params( | ||
global_strategy = CL.GlobalStrategy(InfeasibleMasterIpHeur, CL.NoBranching, CL.DepthFirst) | ||
), | ||
default_optimizer = with_optimizer(GLPK.Optimizer) | ||
) | ||
|
||
problem, x, dec = CLD.GeneralizedAssignment.model(data, coluna) | ||
|
||
JuMP.optimize!(problem) | ||
@test JuMP.objective_value(problem) == Inf | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function optimizationresults_unit_test() | ||
emptyresults_tests() | ||
end | ||
|
||
function emptyresults_tests() | ||
result = CL.OptimizationResult{CL.MinSense}() | ||
@test CL.getprimalbound(result) == Inf | ||
@test CL.getdualbound(result) == -Inf | ||
@test CL.getbestprimalsol(result) == nothing | ||
@test CL.getbestdualsol(result) == nothing | ||
end |
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