Commit 73ee6045 authored by Sulfyderz's avatar Sulfyderz
Browse files

[Error Update]:Improving the perform method in ilp_iv with os methods.

parent b26979cc
......@@ -28,10 +28,14 @@ class ILP_IV:
f = open(filename, 'w')
self._ilp_write(f)
f.close()
while not os.path.exists(filename):
time.sleep(1)
cmd = 'glpsol --lp {} -o {} &> {}'.format(filename, filename + '.out', filename + '.err')
#print(cmd)
if os.path.exists(filename + '.out'):
os.remove(filename + '.out')
while os.path.exists(filename + '.out'):
time.sleep(1)
os.system(cmd)
time.sleep(1)
while not os.path.exists(filename + '.out'):
......@@ -45,6 +49,8 @@ class ILP_IV:
os.remove(filename)
os.remove(filename+ '.out')
os.remove(filename+ '.err')
while os.path.exists(filename) or os.path.exists(filename+ '.out') or os.path.exists(filename+ '.err'):
time.sleep(1)
return table, cluster_dict
def _ilp_write(self, f):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment