IGJSP 1.1.3__py3-none-any.whl → 1.1.5__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
|
@@ -150,17 +150,17 @@ class JSP:
|
|
|
150
150
|
np.random.seed(seed)
|
|
151
151
|
self.rddd = rddd
|
|
152
152
|
self.speed = speed
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
#Elimino por que no hace caso del seed. Se tiene que hacer antes de llamar a esta función
|
|
154
|
+
# if not tpm or len(tpm) != self.numMchs:
|
|
155
|
+
# if distribution == "uniform":
|
|
156
|
+
# tpm = np.random.uniform(10, 100, self.numMchs)
|
|
157
|
+
# elif distribution == "normal":
|
|
158
|
+
# tpm = [max(10, data) for data in np.random.normal(50, 20, self.numMchs)]
|
|
159
|
+
# else:
|
|
160
|
+
# tpm = expon(loc=10, scale=20).rvs(self.numMchs)
|
|
161
161
|
energyPer, timePer = self._particionate_speed_space(speed)
|
|
162
|
-
self._generate_standar_operation_cost(distribution)
|
|
163
|
-
|
|
162
|
+
self._generate_standar_operation_cost(distribution,tpm)
|
|
163
|
+
|
|
164
164
|
self.ProcessingTime = np.zeros((self.numJobs, self.numMchs, self.speed), dtype=int)
|
|
165
165
|
self.EnergyConsumption = np.zeros((self.numJobs, self.numMchs, self.speed), dtype=int)
|
|
166
166
|
self.Orden = np.zeros((self.numJobs, self.numMchs), dtype=int)
|
|
@@ -186,13 +186,16 @@ class JSP:
|
|
|
186
186
|
timePer = [t(c) for c in energyPer]
|
|
187
187
|
return energyPer, timePer
|
|
188
188
|
|
|
189
|
-
def _generate_standar_operation_cost(self, distribution):
|
|
190
|
-
if
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
def _generate_standar_operation_cost(self, distribution,tpm=[]):
|
|
190
|
+
if np.array(tpm).shape != (self.numJobs, self.numMchs):
|
|
191
|
+
if distribution == "uniform":
|
|
192
|
+
self.operationCost = np.random.uniform(10, 100, (self.numJobs, self.numMchs))
|
|
193
|
+
elif distribution == "normal":
|
|
194
|
+
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)
|
|
195
|
+
elif distribution == "exponential":
|
|
196
|
+
self.operationCost = np.random.exponential(10, (self.numJobs, self.numMchs))
|
|
197
|
+
else:
|
|
198
|
+
self.operationCost = tpm
|
|
196
199
|
|
|
197
200
|
def _jobToMachine(self, release_date_tasks, timePer, distribution):
|
|
198
201
|
for job in range(self.numJobs):
|
|
@@ -212,6 +215,7 @@ class JSP:
|
|
|
212
215
|
releaseDateTask += np.median(self.ProcessingTime[job, machine, :])
|
|
213
216
|
if self.rddd == 1:
|
|
214
217
|
self.ReleaseDueDate[job] = [initial, int(self._release_due(releaseDateTask, distribution))]
|
|
218
|
+
|
|
215
219
|
|
|
216
220
|
def _genProcEnergy(self, job, machine, timePer):
|
|
217
221
|
ans = []
|
|
@@ -662,17 +666,19 @@ class JSP:
|
|
|
662
666
|
}
|
|
663
667
|
|
|
664
668
|
if t == 1:
|
|
665
|
-
replace_data["releaseDate"] = str(
|
|
666
|
-
replace_data["
|
|
669
|
+
replace_data["releaseDate"] = str(data.ReleaseDueDate[:, 0].flatten()).replace(" ",", ")
|
|
670
|
+
# replace_data["releaseDate"] = ", ".join(list(map(str,data.ReleaseDueDate[:, 0])))
|
|
671
|
+
replace_data["dueDate"] = str(data.ReleaseDueDate[:, 1].flatten()).replace(" ",", ")
|
|
672
|
+
|
|
667
673
|
elif t == 2:
|
|
668
|
-
replace_data["releaseDate"] = str(data.ReleaseDueDate[
|
|
669
|
-
replace_data["dueDate"] = str(data.ReleaseDueDate[:, :, 1].flatten()).replace("
|
|
674
|
+
replace_data["releaseDate"] = str(data.ReleaseDueDate[:,:, 0].flatten()).replace(" ",", ")
|
|
675
|
+
replace_data["dueDate"] = str(data.ReleaseDueDate[:, :, 1].flatten()).replace(" ",", ")
|
|
670
676
|
|
|
671
677
|
for job in range(data.numJobs):
|
|
672
678
|
for i, prioridad in enumerate(range(data.numMchs)):
|
|
673
679
|
precedence[job, data.Orden[job, prioridad]] = i
|
|
674
680
|
|
|
675
|
-
replace_data["precedence"] = str(precedence.flatten()).replace(" ", ",")
|
|
681
|
+
replace_data["precedence"] = str(precedence.flatten()).replace(" ", ", ")
|
|
676
682
|
filedata = _read_text_resource(f"Minizinc/Types/RD/JSP/type{t}.dzn")
|
|
677
683
|
# with open(f"./Minizinc/Types/RD/JSP/type{t}.dzn", "r", encoding="utf-8") as file:
|
|
678
684
|
# filedata = file.read()
|
|
@@ -1125,10 +1131,27 @@ class Generator:
|
|
|
1125
1131
|
jsp_instance = JSP(jobs = jobs, machines = machines)
|
|
1126
1132
|
case "FJSP":
|
|
1127
1133
|
jsp_instance = FJSP(jobs = jobs, machines = machines)
|
|
1134
|
+
|
|
1135
|
+
tpm_aux=[]
|
|
1136
|
+
orden_aux=[]
|
|
1137
|
+
for index in range(1, size + 1):
|
|
1138
|
+
if len(tpm) != machines:
|
|
1139
|
+
if distribution == "uniform":
|
|
1140
|
+
aux = np.random.uniform(10, 100, (jobs, machines))
|
|
1141
|
+
elif distribution == "normal":
|
|
1142
|
+
aux = np.array([max(10, x) for x in np.random.normal(50, 20, (jobs, machines)).reshape(-1)]).reshape(jobs, machines)
|
|
1143
|
+
elif distribution == "exponential":
|
|
1144
|
+
aux = np.random.exponential(10, (jobs, machines))
|
|
1145
|
+
tpm_aux.append(aux)
|
|
1146
|
+
|
|
1147
|
+
orden_aux.append([np.random.choice(range(machines), machines, replace=False) for job in range(jobs)])
|
|
1148
|
+
|
|
1149
|
+
orden_aux = np.array(orden_aux)
|
|
1128
1150
|
|
|
1129
1151
|
for index in range(1, size + 1):
|
|
1130
|
-
jsp_instance.fill_random_values(speed = speed, rddd = ReleaseDateDueDate, distribution = distribution, seed = seed,tpm = tpm)
|
|
1131
1152
|
|
|
1153
|
+
jsp_instance.fill_random_values(speed = speed, rddd = ReleaseDateDueDate, distribution = distribution, seed = seed,tpm = tpm_aux[index-1])
|
|
1154
|
+
jsp_instance.Orden = orden_aux[index-1]
|
|
1132
1155
|
# Determinar el nombre de salida basado en `outputName` y los parámetros actuales
|
|
1133
1156
|
problem_path = self.savepath.format(size = size, jobs =jobs, machines = machines, release_due_date = ReleaseDateDueDate, speed_scaling = speed, distribution = distribution, seed=seed)
|
|
1134
1157
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: IGJSP
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.5
|
|
4
4
|
Summary: Instance generator for JSP
|
|
5
5
|
Project-URL: Homepage, https://gps.blogs.upv.es/
|
|
6
6
|
Author-email: GPS-UPV <gps@dsic.upv.es>
|
|
@@ -11,7 +11,6 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Requires-Dist: numpy
|
|
13
13
|
Requires-Dist: scipy
|
|
14
|
-
Requires-Dist: tqdm
|
|
15
14
|
Description-Content-Type: text/markdown
|
|
16
15
|
|
|
17
16
|
# Instance Generator for JSP & FJSP (Energy‑aware)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
IGJSP/generador.py,sha256=
|
|
1
|
+
IGJSP/generador.py,sha256=X5iDlDtxPNi6VpUV7e7EbH34rpQ7cM-nulVaKJ1Pk7g,51899
|
|
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.5.dist-info/METADATA,sha256=85CbRPBMYGyUWjZUHQjTVEfMCy8vKyIIkpSAMptfg5c,10589
|
|
16
|
+
igjsp-1.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
igjsp-1.1.5.dist-info/licenses/LICENSE,sha256=f7RDRO-z_nMoooAya7NAb8sXtrHR6WnttYtyUc9fB-c,1116
|
|
18
|
+
igjsp-1.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|