#NEWLINE# def __init__( self , lp_data , work_dir = Work_dir , clean = True , verbose = False ) : #NEWLINE# #INDENT# self . work_dir = work_dir #NEWLINE# self . clean = clean #NEWLINE# self . verbose = verbose #NEWLINE# mkdir ( work_dir ) #NEWLINE# lpfile = op . join ( work_dir , 'data.lp' ) #NEWLINE# logging . debug ( 'write MIP instance to `{0}`' . format ( lpfile ) ) #NEWLINE# fw = open ( lpfile , 'w' ) #NEWLINE# fw . write ( lpfile ) #NEWLINE# fw . close ( ) #NEWLINE# ( retcode , outfile ) = self . run ( lpfile ) #NEWLINE# if ( retcode < 0 ) : #NEWLINE# #INDENT# self . results = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . results = self . parse_output ( outfile ) #NEWLINE# #UNINDENT# if self . results : #NEWLINE# #INDENT# logging . debug ( 'optimized objective value ({0})' . format ( self . obj_val ) )