def save_solution(status)
      status = case status
               when 0, GLPK::GLP_EMIPGAP
                 :optimized
               when GLPK::GLP_EBOUND, GLPK::GLP_EROOT, GLPK::GLP_ENOPFS
                 :invalid
               else
                 :unknown
               end

      if status == :optimized
        objective_value = GLPK.glp_mip_obj_val @ptr
        variable_values = [nil]
        @variables.each do |var|
          variable_values << GLPK.glp_mip_col_val(@ptr, var.index)
        end
      else
        objective_value = nil
        variable_values = []
      end

      @solution = Solution.new status, objective_value, variable_values
    end
def save_solution(status)
      status = case status
               when 0, GLPK::GLP_EMIPGAP
                 :optimized
               when GLPK::GLP_EBOUND, GLPK::GLP_EROOT, GLPK::GLP_ENOPFS
                 :invalid
               else
                 :unknown
               end

      if status == :optimized
        objective_value = GLPK.glp_mip_obj_val @ptr
        variable_values = [nil]
        @variables.each do |var|
          variable_values << GLPK.glp_mip_col_val(@ptr, var.index)
        end
      else
        objective_value = nil
        variable_values = []
      end

      @solution = Solution.new status, objective_value, variable_values
    end
Save the solution to the model for access later