mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-07 16:58:52 -06:00
Make python classes available in Julia
This commit is contained in:
@@ -250,12 +250,14 @@ end
|
||||
function _fix_variables(model::JuMP.Model, var_names, var_values, stats)
|
||||
vars = [variable_by_name(model, v) for v in var_names]
|
||||
for (i, var) in enumerate(vars)
|
||||
fix(var, var_values[i], force=true)
|
||||
fix(var, var_values[i], force = true)
|
||||
end
|
||||
end
|
||||
|
||||
function _optimize(model::JuMP.Model)
|
||||
optimize!(model)
|
||||
flush(stdout)
|
||||
Libc.flush_cstdio()
|
||||
end
|
||||
|
||||
function _relax(model::JuMP.Model)
|
||||
@@ -325,3 +327,5 @@ function __init_solvers_jump__()
|
||||
end
|
||||
copy!(JumpModel, Class)
|
||||
end
|
||||
|
||||
export JumpModel
|
||||
|
||||
7
src/solvers/learning.jl
Normal file
7
src/solvers/learning.jl
Normal file
@@ -0,0 +1,7 @@
|
||||
global LearningSolver = PyNULL()
|
||||
|
||||
function __init_solvers_learning__()
|
||||
copy!(LearningSolver, pyimport("miplearn.solvers.learning").LearningSolver)
|
||||
end
|
||||
|
||||
export LearningSolver
|
||||
Reference in New Issue
Block a user