IGJSP 1.1.5__py3-none-any.whl → 1.1.7__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
|
@@ -3,6 +3,7 @@ import datetime
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
5
|
import pickle
|
|
6
|
+
import random
|
|
6
7
|
import re
|
|
7
8
|
from itertools import combinations
|
|
8
9
|
|
|
@@ -11,11 +12,11 @@ import numpy as np
|
|
|
11
12
|
|
|
12
13
|
np.set_printoptions(linewidth=np.inf, threshold=np.inf, formatter={"int": lambda x: f"{x}"})
|
|
13
14
|
|
|
15
|
+
from importlib.resources import as_file, files
|
|
14
16
|
from pprint import pprint
|
|
15
17
|
|
|
16
18
|
from scipy.stats import expon, norm, uniform
|
|
17
19
|
|
|
18
|
-
from importlib.resources import files, as_file
|
|
19
20
|
|
|
20
21
|
def _read_text_resource(rel_path: str, encoding: str = "utf-8") -> str:
|
|
21
22
|
p = files("IGJSP").joinpath(rel_path)
|
|
@@ -132,7 +133,7 @@ def _parse_array_generic(text, name):
|
|
|
132
133
|
|
|
133
134
|
#################################################################################
|
|
134
135
|
# #
|
|
135
|
-
# JSP
|
|
136
|
+
# JSP #
|
|
136
137
|
# #
|
|
137
138
|
#################################################################################
|
|
138
139
|
|
|
@@ -161,6 +162,9 @@ class JSP:
|
|
|
161
162
|
energyPer, timePer = self._particionate_speed_space(speed)
|
|
162
163
|
self._generate_standar_operation_cost(distribution,tpm)
|
|
163
164
|
|
|
165
|
+
energyPer, timePer = self._particionate_speed_space(speed)
|
|
166
|
+
self._generate_standar_operation_cost(distribution)
|
|
167
|
+
|
|
164
168
|
self.ProcessingTime = np.zeros((self.numJobs, self.numMchs, self.speed), dtype=int)
|
|
165
169
|
self.EnergyConsumption = np.zeros((self.numJobs, self.numMchs, self.speed), dtype=int)
|
|
166
170
|
self.Orden = np.zeros((self.numJobs, self.numMchs), dtype=int)
|
|
@@ -183,7 +187,8 @@ class JSP:
|
|
|
183
187
|
|
|
184
188
|
def _particionate_speed_space(self, speed):
|
|
185
189
|
energyPer = np.linspace(0.5, 3, speed) if speed > 1 else [1]
|
|
186
|
-
timePer = [t(c) for c in energyPer]
|
|
190
|
+
# timePer = [t(c) for c in energyPer]
|
|
191
|
+
timePer = sorted([random.uniform(0, 100)/100 for _ in range(3)])
|
|
187
192
|
return energyPer, timePer
|
|
188
193
|
|
|
189
194
|
def _generate_standar_operation_cost(self, distribution,tpm=[]):
|
|
@@ -213,16 +218,18 @@ class JSP:
|
|
|
213
218
|
self.ReleaseDueDate[job, machine, 1] = releaseDateTask
|
|
214
219
|
else:
|
|
215
220
|
releaseDateTask += np.median(self.ProcessingTime[job, machine, :])
|
|
221
|
+
|
|
216
222
|
if self.rddd == 1:
|
|
217
223
|
self.ReleaseDueDate[job] = [initial, int(self._release_due(releaseDateTask, distribution))]
|
|
218
|
-
|
|
219
224
|
|
|
220
225
|
def _genProcEnergy(self, job, machine, timePer):
|
|
221
|
-
ans = []
|
|
222
|
-
for tper in timePer:
|
|
223
|
-
time = max(1, self.operationCost[job, machine] * tper)
|
|
224
|
-
ans.append((time, max(1, f(time))))
|
|
225
|
-
|
|
226
|
+
# ans = []
|
|
227
|
+
# for tper in timePer:
|
|
228
|
+
# time = max(1, self.operationCost[job, machine] * tper)
|
|
229
|
+
# ans.append((time, max(1, f(time))))
|
|
230
|
+
# ans.append((time, max(1, f(time))))
|
|
231
|
+
timePer = sorted([random.uniform(0, 100)/100 for _ in range(3)])
|
|
232
|
+
return [(round(i*100),round((1-i)*100)) for i in timePer]
|
|
226
233
|
|
|
227
234
|
def _release_due(self, duration, distribution):
|
|
228
235
|
if distribution == "uniform":
|
|
@@ -667,7 +674,6 @@ class JSP:
|
|
|
667
674
|
|
|
668
675
|
if t == 1:
|
|
669
676
|
replace_data["releaseDate"] = str(data.ReleaseDueDate[:, 0].flatten()).replace(" ",", ")
|
|
670
|
-
# replace_data["releaseDate"] = ", ".join(list(map(str,data.ReleaseDueDate[:, 0])))
|
|
671
677
|
replace_data["dueDate"] = str(data.ReleaseDueDate[:, 1].flatten()).replace(" ",", ")
|
|
672
678
|
|
|
673
679
|
elif t == 2:
|
|
@@ -679,6 +685,7 @@ class JSP:
|
|
|
679
685
|
precedence[job, data.Orden[job, prioridad]] = i
|
|
680
686
|
|
|
681
687
|
replace_data["precedence"] = str(precedence.flatten()).replace(" ", ", ")
|
|
688
|
+
|
|
682
689
|
filedata = _read_text_resource(f"Minizinc/Types/RD/JSP/type{t}.dzn")
|
|
683
690
|
# with open(f"./Minizinc/Types/RD/JSP/type{t}.dzn", "r", encoding="utf-8") as file:
|
|
684
691
|
# filedata = file.read()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
IGJSP/generador.py,sha256=
|
|
1
|
+
IGJSP/generador.py,sha256=upjnvXovOjXOIc4IsMmNYDgvJ9EJD5_xICY6nZ8QyCE,52223
|
|
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.7.dist-info/METADATA,sha256=2S9M5BhlreyQLtxQi1AL5D_ZNhLAzpJ49hALp87-e-o,10589
|
|
16
|
+
igjsp-1.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
igjsp-1.1.7.dist-info/licenses/LICENSE,sha256=f7RDRO-z_nMoooAya7NAb8sXtrHR6WnttYtyUc9fB-c,1116
|
|
18
|
+
igjsp-1.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|