Changeset 2854


Ignore:
Timestamp:
Jul 26, 2010 11:53:26 PM (9 years ago)
Author:
jwatson
Message:

Fixed exception raised by GLPK plugin when encountering the previously unknown NF (non-basic free/unbounded variable) in a solution file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/trunk/coopr/plugins/mip/GLPK.py

    r2825 r2854  
    467467
    468468                   if lp_solution is True:
     469
    469470                      state_string = line[20:22].strip()
    470471                      marginal_string = line[65:78].strip()
     
    517518                      if state_string == "B":
    518519                         variable_value = activity
    519                       elif (state_string == "NL") or (state_string == "NS") or (state_string == "NU"):
     520                      elif (state_string == "NL") or (state_string == "NS") or (state_string == "NU") or (state_string == "NF"):
     521                         # NF = non-basic free (unbounded) variable
     522                         # NL = non-basic variable at its lower bound
     523                         # NU = non-basic variable at its upper bound
     524                         # NS = non-basic fixed variable
    520525                         variable_value = activity
    521526                      else:
    522                          raise ValueError, "Unknown status="+state_string+" encountered for variable="+active_variable_name+" in line="+line+" of solution file="+self.soln_file
     527                         raise ValueError, "Unknown status="+state_string+" encountered for variable="+variable_name+" in the following line of the GLPK solution file="+self.soln_file+":\n"+line
    523528
    524529                      soln.variable[variable_name].value = variable_value
     
    535540           INPUT.close()           
    536541
    537         except ValueError:
     542        except ValueError, msg:
    538543           INPUT.close()
    539            raise RuntimeError
     544           raise RuntimeError, msg
    540545        except Exception:
    541546           INPUT.close()           
Note: See TracChangeset for help on using the changeset viewer.