Changeset 3080


Ignore:
Timestamp:
Oct 11, 2010 2:30:38 PM (11 years ago)
Author:
jwatson
Message:

Commit of version of Gurobi plug-in that solves diet under Windows

File:
1 edited

Legend:

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

    r3079 r3080  
    7777    def executable(self):
    7878       
    79         if sys.platform == "win32":
     79        if sys.platform == 'win32':
    8080           executable = pyutilib.services.registered_executable("gurobi.bat")
    8181        else:
     
    115115        gurobi_script_file.write("sys.path.append("+"\""+os.path.dirname(__file__)+"\""+")\n")
    116116        gurobi_script_file.write("from GUROBI_RUN import *\n")
    117         gurobi_script_file.write("gurobi_run(\""+self._problem_files[0]+"\",\""+self.soln_file+"\")\n")
     117        if sys.platform == 'win32':
     118           problem_filename = "\'"+string.replace(self._problem_files[0], "\\", "\\\\")+"\'"
     119           solution_filename = "\'"+string.replace(self.soln_file, "\\", "\\\\")+"\'"
     120        else:
     121           problem_filename = self._problem_files[0]
     122           solution_filename = self.soln_file
     123        gurobi_script_file.write("gurobi_run("+problem_filename+", "+solution_filename+")"+"\n")
    118124        gurobi_script_file.write("quit()\n")
    119125        gurobi_script_file.close()
     
    188194        results.solution.insert(soln)
    189195
    190 if sys.platform == "win32":
    191    pyutilib.services.register_executable(name="gurobi.bat")
     196if sys.platform == 'win32':
     197   pyutilib.services.register_executable(name='gurobi.bat')
    192198else:
    193    pyutilib.services.register_executable(name="gurobi.sh")
     199   pyutilib.services.register_executable(name='gurobi.sh')
Note: See TracChangeset for help on using the changeset viewer.