Changeset 1954


Ignore:
Timestamp:
Dec 1, 2009 10:20:15 PM (10 years ago)
Author:
jwatson
Message:

Extracting solver runtime for CPLEX solver plugin, at the request of Steven from UC Davis. Extracting solver status is a major issue across-the-board for all solvers, as we are only populating a limited number of the fields (although the full set of statistics is available).

File:
1 edited

Legend:

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

    r1939 r1954  
    247247        #
    248248        for line in output.split("\n"):
    249 #            print "LINE",line
    250249            tokens = re.split('[ \t]+',line.strip())
    251250            if len(tokens) > 3 and tokens[0] == "CPLEX" and tokens[1] == "Error":
     
    272271            elif len(tokens) >= 5 and tokens[4] == "MAXIMIZE":
    273272                results.problem.sense = ProblemSense.maximize
     273            elif len(tokens) >= 4 and tokens[0] == "Solution" and tokens[1] == "time" and tokens[2] == "=":
     274               # technically, I'm not sure if this is CPLEX user time or user+system - CPLEX doesn't appear
     275               # to differentiate, and I'm not sure we can always provide a break-down.
     276               results.solver.user_time = eval(tokens[3])
    274277        return results
    275278
Note: See TracChangeset for help on using the changeset viewer.