IGJSP 0.0.2__py3-none-any.whl → 0.0.3__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
@@ -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
- for t in [0, 1, 2]:
172
- for s in range(1,self.speed):
173
- s0, sf, sp = [0,s,1]
174
- time = data.ProcessingTime[:, :, s0:sf:sp]
175
- energy = data.EnergyConsumption[:, :, s0:sf:sp]
176
- precedence = np.full((data.numJobs, data.numMchs), 0)
177
-
178
- replace_data = {
179
- "machines": data.numMchs,
180
- "jobs": data.numJobs,
181
- "Speed": s,
182
- "time": list(time.flatten()),
183
- "energy": list(energy.flatten())
184
- }
185
-
186
- if t == 1:
187
- replace_data["releaseDate"] = [data.ReleaseDueDate[job, :, 0].min() for job in range(data.numJobs)]
188
- replace_data["dueDate"] = [data.ReleaseDueDate[job, :, 0].max() for job in range(data.numJobs)]
189
- elif t == 2:
190
- replace_data["releaseDate"] = list(data.ReleaseDueDate[:, :, 0].flatten())
191
- replace_data["dueDate"] = list(data.ReleaseDueDate[:, :, 1].flatten())
192
-
193
- for job in range(data.numJobs):
194
- for i, prioridad in enumerate(range(data.numMchs)):
195
- precedence[job, data.Orden[job, prioridad]] = i
196
- replace_data["precedence"] = list(precedence.flatten())
197
-
198
- new_object = data.change_rddd_type(t).select_speeds(list(range(s0, sf, sp)))
199
-
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)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: IGJSP
3
- Version: 0.0.2
3
+ Version: 0.0.3
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>
@@ -1,4 +1,4 @@
1
- IGJSP/generador.py,sha256=QEeDbQmnBASEfxVQNiNGAlbKKcyOpzskfRuKImShX_0,22240
1
+ IGJSP/generador.py,sha256=U4xy63dWzS9rp_npQJbmMXirVRZxWluSeE4cth36U1A,22128
2
2
  IGJSP/main.py,sha256=qnpAdI9Nymfbb2t674EHKCZr1vG80tGyVT5RKMiGvZM,2727
3
3
  IGJSP/Minizinc/Models/RD/JSP0.mzn,sha256=cfN_E3RQ6nBulGfaOOYTd-zAgA5SI6E2saDlYtKCflg,2282
4
4
  IGJSP/Minizinc/Models/RD/JSP1.mzn,sha256=5B8cyw2WyKR8yEL1fFd0TaCAVhjPoxEJRJDPPEjJGEk,2840
@@ -9,7 +9,7 @@ IGJSP/Minizinc/Types/RD/JSP2.mzn,sha256=ATqpg-Ow_VzjQJ_hZSSXiTXmwmqNqFsq81TZgcnj
9
9
  IGJSP/Minizinc/Types/RD/type0.dzn,sha256=alo54TrPd2svp-YeOq8rNhb42Aj5w4N1y1WYRxZ-aWM,225
10
10
  IGJSP/Minizinc/Types/RD/type1.dzn,sha256=r3f1uOoDnscjpXHbpvOWPGhGN0tmwkJ3NYIRP-NGk5M,298
11
11
  IGJSP/Minizinc/Types/RD/type2.dzn,sha256=ddJxLqR_WlUpycHhA_QulxiTx3o9neIzNESEt59VUx0,344
12
- igjsp-0.0.2.dist-info/METADATA,sha256=Uh70eDLvUbIVh65ZlEpCrDSRUAZ3CFzO9eepxoQ6ezA,7369
13
- igjsp-0.0.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
14
- igjsp-0.0.2.dist-info/licenses/LICENSE,sha256=JJvw-24-Kyyqu80L6pZ5UImXjuvta4gcDwypMgItrro,1079
15
- igjsp-0.0.2.dist-info/RECORD,,
12
+ igjsp-0.0.3.dist-info/METADATA,sha256=XXVu9TscGqrQMBpKUspi3iwjHGAAhozcimkoCmhU-ys,7369
13
+ igjsp-0.0.3.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
14
+ igjsp-0.0.3.dist-info/licenses/LICENSE,sha256=JJvw-24-Kyyqu80L6pZ5UImXjuvta4gcDwypMgItrro,1079
15
+ igjsp-0.0.3.dist-info/RECORD,,
File without changes