Changeset 2100


Ignore:
Timestamp:
Jan 2, 2010 1:01:35 AM (10 years ago)
Author:
wehart
Message:

Adding information about termination conditions to CPLEX solver.

File:
1 edited

Legend:

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

    r2065 r2100  
    285285               # to differentiate, and I'm not sure we can always provide a break-down.
    286286               results.solver.user_time = eval(tokens[3])
     287            elif len(tokens) >= 4 and tokens == ['MIP', '-', 'Integer', 'infeasible.']:
     288                results.solver.termination_condition = TerminationCondition.infeasible
     289                results.solver.termination_message = ' '.join(tokens)
     290            elif len(tokens) >= 3 and tokens == ['Presolve', '-', 'Infeasible.']:
     291                results.solver.termination_condition = TerminationCondition.infeasible
     292                results.solver.termination_message = ' '.join(tokens)
     293            elif len(tokens) >= 5 and tokens == ['Presolve', '-', 'Unbounded', 'or', 'infeasible.']:
     294                # It isn't clear whether we can determine if the problem is unbounded from
     295                # CPLEX's output.
     296                results.solver.termination_condition = TerminationCondition.unbounded
     297                results.solver.termination_message = ' '.join(tokens)
    287298        return results
    288299
     
    299310        for line in INPUT:
    300311            line = line.strip()
    301             #print "LLINE",line
    302312            line = line.lstrip('<?/')
    303313            line = line.rstrip('/>?')
Note: See TracChangeset for help on using the changeset viewer.