jump-dev / AmplNLWriter.jl

A Julia interface to AMPL-enabled solvers
http://ampl.com/products/solvers/all-solvers-for-ampl/
MIT License
65 stars 18 forks source link

no solver message (or white spaces) in solution file (.sol) #32

Closed kibaekkim closed 8 years ago

kibaekkim commented 8 years ago

There might be no solver message in solution file. For example, a MINLP solver minotaur generates solution file without any solver message. To address such case, please incorporate the following modification to lines 574-579 in AmplNLWriter.jl:

    # Skip the following lines when there is no solver message or just white spaces.
    if strip(chomp(line)) != "Options"
        # Keep building solver message by reading until empty line
        while true
            m.solve_message *= line
            line = readline(f)
            strip(chomp(line)) == "" && break
        end
        @assert chomp(readline(f)) == "Options"
    end
kibaekkim commented 8 years ago

made a pull request