Changeset 1971
- Timestamp:
- Dec 6, 2009 6:24:10 PM (11 years ago)
- Location:
- coopr.plugins/stable/2.1
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
coopr.plugins/stable/2.1
- Property svnmerge-integrated changed
/coopr.plugins/trunk merged: 1954,1965,1969-1970
- Property svnmerge-integrated changed
-
coopr.plugins/stable/2.1/coopr/plugins/mip/CPLEX.py
r1950 r1971 247 247 # 248 248 for line in output.split("\n"): 249 # print "LINE",line250 249 tokens = re.split('[ \t]+',line.strip()) 251 250 if len(tokens) > 3 and tokens[0] == "CPLEX" and tokens[1] == "Error": … … 272 271 elif len(tokens) >= 5 and tokens[4] == "MAXIMIZE": 273 272 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]) 274 277 return results 275 278 … … 296 299 variable_name = None 297 300 variable_value = None 301 variable_reduced_cost = None 298 302 for i in range(1,len(tokens)): 299 303 field_name = string.strip(tokens[i].split('=')[0]) … … 303 307 elif field_name == "value": 304 308 variable_value = field_value 309 elif field_name == "reducedCost": 310 variable_reduced_cost = field_value 311 305 312 # skip the "constant-one" variable, used to capture/retain objective offsets in the CPLEX LP format. 306 313 if variable_name != "ONE_VAR_CONSTANT": … … 310 317 except: 311 318 soln.variable[variable_name].value = variable_value 319 if not variable_reduced_cost is None: 320 try: 321 soln.variable[variable_name].rc = eval(variable_reduced_cost) 322 except: 323 soln.variable[variable_name].rc = variable_reduced_cost 312 324 elif tokens[0] == "constraint": 313 325 constraint_name = None -
coopr.plugins/stable/2.1/coopr/plugins/tests/mip/test1_cplex.txt
r1950 r1971 44 44 Id: 0 45 45 Value: 1 46 X12: 47 Id: 1 48 Rc: 1 49 X13: 50 Id: 2 51 Rc: 2 52 X21: 53 Id: 3 54 Rc: 1 55 X22: 56 Id: 4 57 Rc: 2 46 58 X23: 47 59 Id: 5 48 60 Value: 1 61 X31: 62 Id: 6 63 Rc: 2 49 64 X32: 50 65 Id: 7 51 66 Value: 1 67 X33: 68 Id: 8 69 Rc: 1 52 70 Constraint: 53 71 NODEA1: -
coopr.plugins/stable/2.1/coopr/plugins/tests/mip/test4_cplex.txt
r1950 r1971 41 41 Value: 88.578 42 42 Variable: 43 x0: 44 Id: 0 45 Rc: 1.3 46 x1: 47 Id: 1 48 Rc: 0.07 49 x2: 50 Id: 2 51 Rc: 1.03 52 x3: 53 Id: 3 54 Rc: 1.63 43 55 x4: 44 56 Id: 4 45 57 Value: 46.8666666667 58 x5: 59 Id: 5 60 Rc: 0.1 61 x6: 62 Id: 6 63 Rc: 0.1 64 x7: 65 Id: 7 66 Rc: 1.23 46 67 Constraint: 47 68 cons0: -
coopr.plugins/stable/2.1/coopr/plugins/tests/mip/test_pico.py
r1950 r1971 102 102 else: 103 103 try: 104 results = self.pico.solve(currdir+"test4.nl", logfile=currdir+"test_solve4.log")104 results = self.pico.solve(currdir+"test4.nl", rformat=ResultsFormat.sol, logfile=currdir+"test_solve4.log") 105 105 except coopr.opt.ConverterError: 106 106 pass
Note: See TracChangeset
for help on using the changeset viewer.