Commit 86a1e1a5 authored by Marc Serramia's avatar Marc Serramia

Prepared big and hard experiments

parent 45873984
......@@ -5,7 +5,7 @@ import numpy as np
BUILD = True
SOLVE = True
MAINTAIN_PLOT = True
SOLVE_TIME_LIMIT = 3600
SOLVE_TIME_LIMIT = None
ROUNDS = 1
#---PROBLEM GENERATION SETTINGS---
......@@ -23,13 +23,13 @@ RELATION_DENSITY = None
#METHOD2: Density-Incomp-perc
#"""
RELATION_DENSITY = [0.5]
RELATION_DENSITY = [0.01]
INCOMPATIBILITY_PERC = [0.5]
#"""
#---VALUES SETTINGS---
PROB_INDIF_VALUE = np.arange(0.01, 1.01, 0.01)
PROB_VALUE_NORMS = np.arange(0.01, 1.01, 0.01)
PROB_INDIF_VALUE = 0.2
PROB_VALUE_NORMS = 0.2
#---SPECIFIC EXPERIMENT SETTINGS---
......@@ -50,20 +50,20 @@ PERC_VALUES = None #Overwrites NUM_VALUES
"""
#RANGE_NORMS Settings
"""
#"""
EXPERIMENT_TYPE = "RANGE_NORMS"
NUM_NORMS = range(100,900,100)
NUM_NORMS = [3000]
NUM_VALUES = None
PERC_VALUES = 0.1 #Overwrites NUM_VALUES
"""
#"""
#RANGE_VALUES Settings
#"""
"""
EXPERIMENT_TYPE = "RANGE_VALUES"
NUM_NORMS = 500
NUM_VALUES = None
PERC_VALUES = [0.1] #Overwrites NUM_VALUES
#"""
"""
#-----------------PLOTTING PARAMETERS-------------------
......@@ -120,12 +120,12 @@ POINT_SIZE = 10
"""
#VALUES HEATMAP SETTINGS:
#"""
"""
PLOT_TYPE = "VALUES_HEATMAP"
TO_PLOT = "BUILD"
PLOT_NORMS = 500
POINT_SIZE = 10
#"""
"""
#-----------------PROBLEM VISUALISER-----------------------
......
......@@ -251,7 +251,7 @@ class Problem:
if PARAMETERS.EXPERIMENT_TYPE == "RANGE_VALUES":
print("Generating: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " + str(self.num_values) + "V "+ str(self.round) + "R")
else:
print("Generating: " + str(self.num_norms) + "N " + str(self.height) + "H " + str(self.width) + "W " + str(self.round) + "R")
print("Generating: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " +str(100-int(self.perc_inc * 100)) + "G " + str(self.round) + "R")
for n in range(self.num_norms):
self.norms[n] = []
self.ancestors[n] = {}
......@@ -270,7 +270,7 @@ class Problem:
if PARAMETERS.EXPERIMENT_TYPE == "RANGE_VALUES":
print("Building: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " + str(self.num_values) + "V "+ str(self.round) + "R")
else:
print("Building: " + str(self.num_norms) + "N " + str(self.height) + "H " + str(self.width) + "W " + str(self.round) + "R")
print("Building: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " +str(100-int(self.perc_inc * 100)) + "G " + str(self.round) + "R")
self.lp = self.getFilename("LP")
lp_file = open(self.lp, "w")
......@@ -357,7 +357,7 @@ class Problem:
if PARAMETERS.EXPERIMENT_TYPE == "RANGE_VALUES":
print("Solving: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " + str(self.num_values) + "V "+ str(self.round) + "R")
else:
print("Solving: " + str(self.num_norms) + "N " + str(self.height) + "H " + str(self.width) + "W " + str(self.round) + "R")
print("Solving: " + str(self.num_norms) + "N " + str(int(self.reldensity * 100)) + "D " + str(int(self.perc_inc * 100)) + "I " +str(100-int(self.perc_inc * 100)) + "G " + str(self.round) + "R")
if not self.lp:
self.lp = self.getFilename("LP")
if self.num_incomp is None or self.direct_gen is None or self.indirect_gen is None:
......@@ -380,7 +380,8 @@ class Problem:
self.sol = self.getFilename("SOL")
try:
m = cplex.Cplex(self.lp)
m.parameters.timelimit.set(PARAMETERS.SOLVE_TIME_LIMIT)
if PARAMETERS.SOLVE_TIME_LIMIT is not None:
m.parameters.timelimit.set(PARAMETERS.SOLVE_TIME_LIMIT)
m.parameters.mip.limits.treememory.set(2800)
m.parameters.threads.set(1)
start_time = time.time()
......
Markdown is supported
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