IGJSP 0.0.8__tar.gz → 0.0.10__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IGJSP
3
- Version: 0.0.8
3
+ Version: 0.0.10
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>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "IGJSP"
7
- version = "0.0.8"
7
+ version = "0.0.10"
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","src/Minizinc"]
29
+ packages = ["src/IGJSP","src/IGJSP/Minizinc"]
@@ -12,7 +12,11 @@ import networkx as nx
12
12
  import numpy as np
13
13
  from scipy.stats import expon, norm, uniform
14
14
  from pprint import pprint
15
+ import sys
15
16
 
17
+ import importlib_resources
18
+ from importlib.resources import read_text
19
+ minizinc_files = importlib_resources.files("IGJSP")
16
20
 
17
21
  def f(x):
18
22
  return int(np.exp(-int(x)/100)*100)
@@ -67,6 +71,7 @@ class JSP:
67
71
 
68
72
  self._jobToMachine(release_date_tasks, timePer, distribution)
69
73
  self.generate_maxmin_objective_values()
74
+ self.vectorization()
70
75
 
71
76
  def _particionate_speed_space(self, speed):
72
77
  energyPer = np.linspace(0.5, 3, speed) if speed > 1 else [1]
@@ -181,8 +186,8 @@ class JSP:
181
186
  "machines": data.numMchs,
182
187
  "jobs": data.numJobs,
183
188
  "Speed": s,
184
- "time": list(time.flatten()),
185
- "energy": list(energy.flatten())
189
+ "time": list(map(int,time.flatten())),
190
+ "energy": list(map(int,energy.flatten()))
186
191
  }
187
192
  if t == 1:
188
193
  replace_data["releaseDate"] = [data.ReleaseDueDate[job, 0] for job in range(data.numJobs)]
@@ -194,11 +199,12 @@ class JSP:
194
199
  for job in range(data.numJobs):
195
200
  for i, prioridad in enumerate(range(data.numMchs)):
196
201
  precedence[job, data.Orden[job, prioridad]] = i
197
- replace_data["precedence"] = list(precedence.flatten())
202
+ replace_data["precedence"] = list(map(int,precedence.flatten()))
198
203
 
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:
204
+ # new_object = data.change_rddd_type(t).select_speeds(list(range(s0, sf, sp)))
205
+ with open(minizinc_files.joinpath("Minizinc/Types/RD", f"type{t}.dzn"), "r", encoding="utf-8") as file:
201
206
  filedata = file.read()
207
+ # filedata = file
202
208
  for kk, v in replace_data.items():
203
209
  filedata = filedata.replace("{" + kk + "}", str(v))
204
210
 
@@ -400,7 +406,7 @@ class JSP:
400
406
  vectorization["min_makespan"] = self.min_makespan
401
407
  vectorization["max_sum_energy"] = self.max_energy
402
408
  vectorization["min_sum_energy"] = self.min_energy
403
- vectorization["max_tardiness"] = self.max_tardiness
409
+ vectorization["max_tardiness"] = self.max_tardiness if self.rddd != 0 else 0
404
410
  vectorization["min_window"] = 0
405
411
  vectorization["max_window"] = 0
406
412
  vectorization["mean_window"] = 0
@@ -465,7 +471,7 @@ class JSP:
465
471
  vectorization["max_energy_value"] = np.max(self.ProcessingTime)
466
472
  vectorization["min_energy_value"] = np.min(self.ProcessingTime)
467
473
  vectorization["mean_energy_value"] = np.mean(self.ProcessingTime)
468
-
474
+ self.features = vectorization
469
475
  return vectorization
470
476
 
471
477
  def disjuntive_graph(self):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes