IGJSP 0.0.1__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.1 → igjsp-0.0.3}/PKG-INFO +3 -2
- {igjsp-0.0.1 → igjsp-0.0.3}/README.md +2 -1
- {igjsp-0.0.1 → igjsp-0.0.3}/pyproject.toml +2 -2
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/generador.py +42 -42
- {igjsp-0.0.1 → igjsp-0.0.3}/.vscode/settings.json +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/LICENSE +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP0.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP1.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Models/RD/JSP2.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP0.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP1.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/JSP2.mzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type0.dzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type1.dzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/Minizinc/Types/RD/type2.dzn +0 -0
- {igjsp-0.0.1 → igjsp-0.0.3}/src/IGJSP/main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: IGJSP
|
|
3
|
-
Version: 0.0.
|
|
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>
|
|
@@ -93,7 +93,8 @@ Once the generator has been initialized we proceed to generate different instanc
|
|
|
93
93
|
## Example of JSON generated
|
|
94
94
|
|
|
95
95
|
This JSON shows how the data generated from an JSP problem with 2 machines and 4 jobs will look like. For this generation we have the following code:
|
|
96
|
-
``` python
|
|
96
|
+
``` python
|
|
97
|
+
from IGJSP.generador import Generator
|
|
97
98
|
generator = Generator(json=True,savepath="output")
|
|
98
99
|
generator.generate_new_instance(jobs=4,machines=2,ReleaseDateDueDate=2,distribution="exponential",seed=53)
|
|
99
100
|
```
|
|
@@ -77,7 +77,8 @@ Once the generator has been initialized we proceed to generate different instanc
|
|
|
77
77
|
## Example of JSON generated
|
|
78
78
|
|
|
79
79
|
This JSON shows how the data generated from an JSP problem with 2 machines and 4 jobs will look like. For this generation we have the following code:
|
|
80
|
-
``` python
|
|
80
|
+
``` python
|
|
81
|
+
from IGJSP.generador import Generator
|
|
81
82
|
generator = Generator(json=True,savepath="output")
|
|
82
83
|
generator.generate_new_instance(jobs=4,machines=2,ReleaseDateDueDate=2,distribution="exponential",seed=53)
|
|
83
84
|
```
|
|
@@ -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)
|
|
@@ -445,7 +445,7 @@ class JSP:
|
|
|
445
445
|
# jsp.saveTaillardStandardFile("./output_taillard.txt")
|
|
446
446
|
|
|
447
447
|
class Generator:
|
|
448
|
-
def __init__( self,json = False, dzn = False, taillard = False, savepath=""):
|
|
448
|
+
def __init__( self,json = False, dzn = False, taillard = False, savepath="./"):
|
|
449
449
|
self.json = json
|
|
450
450
|
self.dzn = dzn
|
|
451
451
|
self.taillard = taillard
|
|
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
|