The function print(model) outputs the model in the console. How can I print the model in a file (e.g. lp file) ?
Best
Michael.
The function print(model) outputs the model in the console. How can I print the model in a file (e.g. lp file) ?
Best
Michael.
Thank's ! This works:
f = open("model.lp", "w")
print(f, model)
close(f)
# Using `do` one doesn't have to remember to call `close(f)`
open("model.lp", "w") do f
print(f, model)
end
Julia's JuMP has inbuilt method writeLP, which takes Model and filename to the model is to be written.
writeLP(m::Model, filename::AbstractString; genericnames=true)
More details can be found here JuMP Documentation