IGJSP 1.1.6__py3-none-any.whl → 1.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
IGJSP/generador.py
CHANGED
|
@@ -133,7 +133,7 @@ def _parse_array_generic(text, name):
|
|
|
133
133
|
|
|
134
134
|
#################################################################################
|
|
135
135
|
# #
|
|
136
|
-
# JSP
|
|
136
|
+
# JSP #
|
|
137
137
|
# #
|
|
138
138
|
#################################################################################
|
|
139
139
|
|
|
@@ -151,14 +151,17 @@ class JSP:
|
|
|
151
151
|
np.random.seed(seed)
|
|
152
152
|
self.rddd = rddd
|
|
153
153
|
self.speed = speed
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
154
|
+
#Elimino por que no hace caso del seed. Se tiene que hacer antes de llamar a esta función
|
|
155
|
+
# if not tpm or len(tpm) != self.numMchs:
|
|
156
|
+
# if distribution == "uniform":
|
|
157
|
+
# tpm = np.random.uniform(10, 100, self.numMchs)
|
|
158
|
+
# elif distribution == "normal":
|
|
159
|
+
# tpm = [max(10, data) for data in np.random.normal(50, 20, self.numMchs)]
|
|
160
|
+
# else:
|
|
161
|
+
# tpm = expon(loc=10, scale=20).rvs(self.numMchs)
|
|
162
|
+
energyPer, timePer = self._particionate_speed_space(speed)
|
|
163
|
+
self._generate_standar_operation_cost(distribution,tpm)
|
|
164
|
+
|
|
162
165
|
energyPer, timePer = self._particionate_speed_space(speed)
|
|
163
166
|
self._generate_standar_operation_cost(distribution)
|
|
164
167
|
|
|
@@ -188,13 +191,16 @@ class JSP:
|
|
|
188
191
|
timePer = sorted([random.uniform(0, 100)/100 for _ in range(3)])
|
|
189
192
|
return energyPer, timePer
|
|
190
193
|
|
|
191
|
-
def _generate_standar_operation_cost(self, distribution):
|
|
192
|
-
if
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
def _generate_standar_operation_cost(self, distribution,tpm=[]):
|
|
195
|
+
if np.array(tpm).shape != (self.numJobs, self.numMchs):
|
|
196
|
+
if distribution == "uniform":
|
|
197
|
+
self.operationCost = np.random.uniform(10, 100, (self.numJobs, self.numMchs))
|
|
198
|
+
elif distribution == "normal":
|
|
199
|
+
self.operationCost = np.array([max(10, x) for x in np.random.normal(50, 20, (self.numJobs, self.numMchs)).reshape(-1)]).reshape(self.numJobs, self.numMchs)
|
|
200
|
+
elif distribution == "exponential":
|
|
201
|
+
self.operationCost = np.random.exponential(10, (self.numJobs, self.numMchs))
|
|
202
|
+
else:
|
|
203
|
+
self.operationCost = tpm
|
|
198
204
|
|
|
199
205
|
def _jobToMachine(self, release_date_tasks, timePer, distribution):
|
|
200
206
|
for job in range(self.numJobs):
|
|
@@ -667,17 +673,19 @@ class JSP:
|
|
|
667
673
|
}
|
|
668
674
|
|
|
669
675
|
if t == 1:
|
|
670
|
-
replace_data["releaseDate"] = str(
|
|
671
|
-
replace_data["dueDate"] = str(
|
|
676
|
+
replace_data["releaseDate"] = str(data.ReleaseDueDate[:, 0].flatten()).replace(" ",", ")
|
|
677
|
+
replace_data["dueDate"] = str(data.ReleaseDueDate[:, 1].flatten()).replace(" ",", ")
|
|
678
|
+
|
|
672
679
|
elif t == 2:
|
|
673
|
-
replace_data["releaseDate"] = str(data.ReleaseDueDate[
|
|
674
|
-
replace_data["dueDate"] = str(data.ReleaseDueDate[:, :, 1].flatten()).replace("
|
|
680
|
+
replace_data["releaseDate"] = str(data.ReleaseDueDate[:,:, 0].flatten()).replace(" ",", ")
|
|
681
|
+
replace_data["dueDate"] = str(data.ReleaseDueDate[:, :, 1].flatten()).replace(" ",", ")
|
|
675
682
|
|
|
676
683
|
for job in range(data.numJobs):
|
|
677
684
|
for i, prioridad in enumerate(range(data.numMchs)):
|
|
678
685
|
precedence[job, data.Orden[job, prioridad]] = i
|
|
679
686
|
|
|
680
|
-
replace_data["precedence"] = str(precedence.flatten()).replace(" ", ",")
|
|
687
|
+
replace_data["precedence"] = str(precedence.flatten()).replace(" ", ", ")
|
|
688
|
+
|
|
681
689
|
filedata = _read_text_resource(f"Minizinc/Types/RD/JSP/type{t}.dzn")
|
|
682
690
|
# with open(f"./Minizinc/Types/RD/JSP/type{t}.dzn", "r", encoding="utf-8") as file:
|
|
683
691
|
# filedata = file.read()
|
|
@@ -1130,11 +1138,27 @@ class Generator:
|
|
|
1130
1138
|
jsp_instance = JSP(jobs = jobs, machines = machines)
|
|
1131
1139
|
case "FJSP":
|
|
1132
1140
|
jsp_instance = FJSP(jobs = jobs, machines = machines)
|
|
1141
|
+
|
|
1142
|
+
tpm_aux=[]
|
|
1143
|
+
orden_aux=[]
|
|
1144
|
+
for index in range(1, size + 1):
|
|
1145
|
+
if len(tpm) != machines:
|
|
1146
|
+
if distribution == "uniform":
|
|
1147
|
+
aux = np.random.uniform(10, 100, (jobs, machines))
|
|
1148
|
+
elif distribution == "normal":
|
|
1149
|
+
aux = np.array([max(10, x) for x in np.random.normal(50, 20, (jobs, machines)).reshape(-1)]).reshape(jobs, machines)
|
|
1150
|
+
elif distribution == "exponential":
|
|
1151
|
+
aux = np.random.exponential(10, (jobs, machines))
|
|
1152
|
+
tpm_aux.append(aux)
|
|
1153
|
+
|
|
1154
|
+
orden_aux.append([np.random.choice(range(machines), machines, replace=False) for job in range(jobs)])
|
|
1155
|
+
|
|
1156
|
+
orden_aux = np.array(orden_aux)
|
|
1133
1157
|
instances = []
|
|
1134
1158
|
for index in range(1, size + 1):
|
|
1135
|
-
|
|
1136
|
-
jsp_instance.fill_random_values(speed = speed, rddd = ReleaseDateDueDate, distribution = distribution, seed = seed,tpm = tpm)
|
|
1137
1159
|
|
|
1160
|
+
jsp_instance.fill_random_values(speed = speed, rddd = ReleaseDateDueDate, distribution = distribution, seed = seed,tpm = tpm_aux[index-1])
|
|
1161
|
+
jsp_instance.Orden = orden_aux[index-1]
|
|
1138
1162
|
# Determinar el nombre de salida basado en `outputName` y los parámetros actuales
|
|
1139
1163
|
problem_path = self.savepath.format(size = size, jobs =jobs, machines = machines, release_due_date = ReleaseDateDueDate, speed_scaling = speed, distribution = distribution, seed=seed)
|
|
1140
1164
|
|
|
@@ -1167,4 +1191,4 @@ class Generator:
|
|
|
1167
1191
|
if self.taillard:
|
|
1168
1192
|
jsp_instance.saveTaillardStandardFile(f"{problem_path}/TAILLARD/" + jm_path.split("/")[0] + f"_{j}x{m}_{i}.txt")
|
|
1169
1193
|
instances.append(jsp_instance)
|
|
1170
|
-
return instances
|
|
1194
|
+
return instances
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
IGJSP/generador.py,sha256=
|
|
1
|
+
IGJSP/generador.py,sha256=gczzt22egyfhVxJw_Ika2E8RLW0AW2hqciNZiNFraBw,52276
|
|
2
2
|
IGJSP/main.py,sha256=Sia5Ss8O3HWBdshvPLJKUMaZIoQPHy6x8yzvojojPFo,2838
|
|
3
3
|
IGJSP/Minizinc/Models/RD/JSP0.mzn,sha256=cfN_E3RQ6nBulGfaOOYTd-zAgA5SI6E2saDlYtKCflg,2282
|
|
4
4
|
IGJSP/Minizinc/Models/RD/JSP1.mzn,sha256=5B8cyw2WyKR8yEL1fFd0TaCAVhjPoxEJRJDPPEjJGEk,2840
|
|
@@ -12,7 +12,7 @@ IGJSP/Minizinc/Types/RD/FJSP/type2.dzn,sha256=Wz1MnkSL5GUPsbh1eq0leoaQRImkNqQqkX
|
|
|
12
12
|
IGJSP/Minizinc/Types/RD/JSP/type0.dzn,sha256=wNuPQkXBXPSpPaPz2WFhp4pGDgfSimtg4I93UfwC01Q,263
|
|
13
13
|
IGJSP/Minizinc/Types/RD/JSP/type1.dzn,sha256=Xbt9StzCgEqqh_HS9tWGrTVtu-OEnf5Yq5Ty91AkzoM,333
|
|
14
14
|
IGJSP/Minizinc/Types/RD/JSP/type2.dzn,sha256=L2nc7bPJEhyuaEwgw0ZCpC52CpVJILQU_WQdKn8GUZs,379
|
|
15
|
-
igjsp-1.1.
|
|
16
|
-
igjsp-1.1.
|
|
17
|
-
igjsp-1.1.
|
|
18
|
-
igjsp-1.1.
|
|
15
|
+
igjsp-1.1.8.dist-info/METADATA,sha256=c1VIJifkzFZ6VJ9ZZTRzMe7FarspzF0MG_olcW4KFBY,10589
|
|
16
|
+
igjsp-1.1.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
igjsp-1.1.8.dist-info/licenses/LICENSE,sha256=f7RDRO-z_nMoooAya7NAb8sXtrHR6WnttYtyUc9fB-c,1116
|
|
18
|
+
igjsp-1.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|