IGJSP 0.0.2__tar.gz → 0.0.3__tar.gz
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-0.0.2 → igjsp-0.0.3}/PKG-INFO +1 -1
- {igjsp-0.0.2 → igjsp-0.0.3}/pyproject.toml +2 -2
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/generador.py +41 -41
- {igjsp-0.0.2 → igjsp-0.0.3}/.vscode/settings.json +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/LICENSE +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/README.md +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP0.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP1.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP2.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP0.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP1.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP2.mzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type0.dzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type1.dzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type2.dzn +0 -0
- {igjsp-0.0.2 → igjsp-0.0.3}/src/IGJSP/main.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "IGJSP"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.3"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="GPS-UPV", email="gps@dsic.upv.es" },
|
|
10
10
|
]
|
|
@@ -26,4 +26,4 @@ dependencies = [
|
|
|
26
26
|
Homepage = "https://gps.blogs.upv.es/"
|
|
27
27
|
|
|
28
28
|
[tool.hatch.build.targets.wheel]
|
|
29
|
-
packages = ["src/IGJSP"]
|
|
29
|
+
packages = ["src/IGJSP","src/Minizinc"]
|
|
@@ -168,47 +168,47 @@ class JSP:
|
|
|
168
168
|
# indexProblema = os.path.basename(os.path.normpath(OutputDir))
|
|
169
169
|
with open(f"{InputDir}", 'rb') as f:
|
|
170
170
|
data: JSP = pickle.load(f)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
171
|
+
print(self.speed)
|
|
172
|
+
# for t in [0, 1, 2]:
|
|
173
|
+
t = data.rddd
|
|
174
|
+
for s in range(1,self.speed+1):
|
|
175
|
+
s0, sf, sp = [0,s,1]
|
|
176
|
+
time = data.ProcessingTime[:, :, s0:sf:sp]
|
|
177
|
+
energy = data.EnergyConsumption[:, :, s0:sf:sp]
|
|
178
|
+
precedence = np.full((data.numJobs, data.numMchs), 0)
|
|
179
|
+
|
|
180
|
+
replace_data = {
|
|
181
|
+
"machines": data.numMchs,
|
|
182
|
+
"jobs": data.numJobs,
|
|
183
|
+
"Speed": s,
|
|
184
|
+
"time": list(time.flatten()),
|
|
185
|
+
"energy": list(energy.flatten())
|
|
186
|
+
}
|
|
187
|
+
if t == 1:
|
|
188
|
+
replace_data["releaseDate"] = [data.ReleaseDueDate[job, 0] for job in range(data.numJobs)]
|
|
189
|
+
replace_data["dueDate"] = [data.ReleaseDueDate[job, 1] for job in range(data.numJobs)]
|
|
190
|
+
elif t == 2:
|
|
191
|
+
replace_data["releaseDate"] = list(data.ReleaseDueDate[:, :, 0].flatten())
|
|
192
|
+
replace_data["dueDate"] = list(data.ReleaseDueDate[:, :, 1].flatten())
|
|
193
|
+
|
|
194
|
+
for job in range(data.numJobs):
|
|
195
|
+
for i, prioridad in enumerate(range(data.numMchs)):
|
|
196
|
+
precedence[job, data.Orden[job, prioridad]] = i
|
|
197
|
+
replace_data["precedence"] = list(precedence.flatten())
|
|
198
|
+
|
|
199
|
+
new_object = data.change_rddd_type(t).select_speeds(list(range(s0, sf, sp)))
|
|
200
|
+
with open(f"./Minizinc/Types/RD/type{t}.dzn", "r", encoding="utf-8") as file:
|
|
201
|
+
filedata = file.read()
|
|
202
|
+
for kk, v in replace_data.items():
|
|
203
|
+
filedata = filedata.replace("{" + kk + "}", str(v))
|
|
204
|
+
|
|
205
|
+
os.makedirs(f"{OutputDir}/", exist_ok=True)
|
|
206
|
+
|
|
207
|
+
with open(f"{OutputDir}/{indexProblema}-{t}-{s}.dzn", "w+", encoding="utf-8") as new:
|
|
208
|
+
new.write(filedata)
|
|
209
|
+
# print(f"{OutputDir}/{indexProblema}")
|
|
210
|
+
# with open(f"{OutputDir}/{indexProblema}", "wb") as new:
|
|
211
|
+
# pickle.dump(new_object, new)
|
|
212
212
|
|
|
213
213
|
def saveTaillardStandardFile(self, path):
|
|
214
214
|
os.makedirs("/".join(path.split("/")[:-1]),exist_ok=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|