Changeset 5742


Ignore:
Timestamp:
04/30/12 15:37:38 (2 years ago)
Author:
gabeh
Message:

Re-adding code by Zev that seems to correctly handle solver options in the nl writer for solvers like cplex, gurobi, and ipopt. I'm not sure if the orignal code works for other solvers so I will leave it for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/trunk/coopr/plugins/solvers/ASL.py

    r5741 r5742  
    103103        if self._timer: 
    104104            cmd.insert(0, self._timer) 
    105              
     105         
     106        # GAH: I am going to re-add the code by Zev that passed options through 
     107        # to the command line. I'm not sure what solvers this method of passing options 
     108        # through the envstr variable works for, but it does not seem to work for cplex 
     109        # or gurobi 
    106110        opt=[] 
    107111        for key in self.options: 
     
    110114            if isinstance(self.options[key],basestring) and ' ' in self.options[key]: 
    111115                opt.append(key+"=\""+str(self.options[key])+"\"") 
     116                cmd.append(str(key)+"="+str(self.options[key])) 
    112117            elif key == 'subsolver': 
    113118                opt.append("solver="+str(self.options[key])) 
     119                cmd.append(str(key)+"="+str(self.options[key])) 
    114120            else: 
    115121                opt.append(key+"="+str(self.options[key])) 
     122                cmd.append(str(key)+"="+str(self.options[key])) 
    116123 
    117124        envstr = "%s_options" % self.options.solver 
Note: See TracChangeset for help on using the changeset viewer.