removed older solvers
This commit is contained in:
@@ -12,7 +12,7 @@ CplexPath = /usr/ilog/cplex/bin/x86_rhel4.0_3.4/libcplex110.so
|
||||
GurobiPath = /opt/gurobi201/linux32/lib/python2.5
|
||||
CbcPath = cbc
|
||||
GlpkPath = glpsol
|
||||
PulpCbcPath = %(here)s/solverdir/cbc
|
||||
PulpCbcPath = %(here)s/solverdir/cbc/%(os)s/%(arch)s/cbc
|
||||
[licenses]
|
||||
ilm_cplex_license = "LICENSE your-enterprise\nRUNTIME NEVER ..."
|
||||
ilm_cplex_license_signature = 0
|
||||
|
||||
@@ -12,7 +12,7 @@ CplexPath = /usr/ilog/cplex/bin/x86_rhel4.0_3.4/libcplex110.so
|
||||
GurobiPath = /opt/gurobi201/linux32/lib/python2.5
|
||||
CbcPath = cbc
|
||||
GlpkPath = glpsol
|
||||
PulpCbcPath = %(here)s/solverdir/cbc-osx
|
||||
PulpCbcPath = %(here)s/solverdir/cbc/%(os)s/cbc
|
||||
[licenses]
|
||||
ilm_cplex_license = "LICENSE your-enterprise\nRUNTIME NEVER ..."
|
||||
ilm_cplex_license_signature = 0
|
||||
|
||||
@@ -10,7 +10,7 @@ CplexPath = cplex100.dll
|
||||
GurobiPath = C:\gurobi10\win32\python2.5\lib
|
||||
CbcPath = cbc
|
||||
GlpkPath = glpsol
|
||||
PulpCbcPath = %(here)s\solverdir\cbc.exe
|
||||
PulpCbcPath = %(here)s\solverdir\cbc\%(os)s\%(arch)s\cbc.exe
|
||||
[licenses]
|
||||
ilm_cplex_license = "LICENSE your-enterprise\nRUNTIME NEVER ..."
|
||||
ilm_cplex_license_signature = 0
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -54,10 +54,11 @@ class PulpSolverError(PulpError):
|
||||
pass
|
||||
|
||||
#import configuration information
|
||||
def initialize(filename):
|
||||
def initialize(filename, operating_system='linux', arch='64'):
|
||||
""" reads the configuration file to initialise the module"""
|
||||
here = os.path.dirname(filename)
|
||||
config = configparser.SafeConfigParser({'here':here})
|
||||
config = configparser.SafeConfigParser({'here':here,
|
||||
'os':operating_system, 'arch':arch})
|
||||
config.read(filename)
|
||||
|
||||
try:
|
||||
@@ -107,12 +108,21 @@ def initialize(filename):
|
||||
|
||||
#pick up the correct config file depending on operating system
|
||||
PULPCFGFILE = "pulp.cfg"
|
||||
operating_system = None
|
||||
if sys.platform in ['win32', 'cli']:
|
||||
operating_system = 'win'
|
||||
PULPCFGFILE += ".win"
|
||||
elif sys.platform in ['darwin']:
|
||||
operating_system = "osx"
|
||||
PULPCFGFILE += ".osx"
|
||||
else:
|
||||
operating_system = "linux"
|
||||
PULPCFGFILE += ".linux"
|
||||
is_64bits = sys.maxsize > 2**32
|
||||
if is_64bits:
|
||||
arch = '64'
|
||||
else:
|
||||
arch = '32'
|
||||
|
||||
if __name__ != '__main__':
|
||||
DIRNAME = os.path.dirname(__file__)
|
||||
@@ -125,7 +135,7 @@ else: #run as a script
|
||||
PULPCFGFILE)
|
||||
cplex_dll_path, ilm_cplex_license, ilm_cplex_license_signature, \
|
||||
coinMP_path, gurobi_path, cbc_path, glpk_path, pulp_cbc_path = \
|
||||
initialize(config_filename)
|
||||
initialize(config_filename, operating_system, arch)
|
||||
|
||||
|
||||
# See later for LpSolverDefault definition
|
||||
@@ -1450,25 +1460,19 @@ class PULP_CBC_CMD(COIN_CMD):
|
||||
"""
|
||||
This solver uses a precompiled version of cbc provided with the package
|
||||
"""
|
||||
arch_pulp_cbc_path = pulp_cbc_path
|
||||
pulp_cbc_path = pulp_cbc_path
|
||||
try:
|
||||
if os.name != 'nt':
|
||||
#not windows
|
||||
is_64bits = sys.maxsize > 2**32
|
||||
if is_64bits:
|
||||
arch_pulp_cbc_path = pulp_cbc_path + '-64'
|
||||
else:
|
||||
arch_pulp_cbc_path = pulp_cbc_path + '-32'
|
||||
if not os.access(arch_pulp_cbc_path, os.X_OK):
|
||||
if not os.access(pulp_cbc_path, os.X_OK):
|
||||
import stat
|
||||
os.chmod(arch_pulp_cbc_path, stat.S_IXUSR + stat.S_IXOTH)
|
||||
os.chmod(pulp_cbc_path, stat.S_IXUSR + stat.S_IXOTH)
|
||||
except: #probably due to incorrect permissions
|
||||
def available(self):
|
||||
"""True if the solver is available"""
|
||||
return False
|
||||
def actualSolve(self, lp, callback = None):
|
||||
"""Solve a well formulated lp problem"""
|
||||
raise PulpSolverError("PULP_CBC_CMD: Not Available (check permissions on %s)" % self.arch_pulp_cbc_path)
|
||||
raise PulpSolverError("PULP_CBC_CMD: Not Available (check permissions on %s)" % self.pulp_cbc_path)
|
||||
else:
|
||||
def __init__(self, path=None, *args, **kwargs):
|
||||
"""
|
||||
@@ -1477,7 +1481,7 @@ class PULP_CBC_CMD(COIN_CMD):
|
||||
if path is not None:
|
||||
raise PulpSolverError('Use COIN_CMD if you want to set a path')
|
||||
#check that the file is executable
|
||||
COIN_CMD.__init__(self, path=self.arch_pulp_cbc_path, *args, **kwargs)
|
||||
COIN_CMD.__init__(self, path=self.pulp_cbc_path, *args, **kwargs)
|
||||
|
||||
def COINMP_DLL_load_dll(path):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user