IGJSP 1.1.0__py3-none-any.whl → 1.1.1__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
@@ -26,6 +26,42 @@ def t(c):
26
26
  return 4.0704 * np.log(2) / np.log(1 + (c* 2.5093)**3)
27
27
 
28
28
 
29
+ # ------- Helpers internos para el DZN -------
30
+
31
+ def _parse_int_var(text, name, default=None):
32
+ """
33
+ Busca una variable escalar tipo: name = 10;
34
+ """
35
+ m = re.search(rf'\b{name}\b\s*=\s*([0-9]+)', text)
36
+ if m:
37
+ return int(m.group(1))
38
+ if default is not None:
39
+ return default
40
+ raise ValueError(f"No se encontró la variable entera '{name}' en el fichero DZN.")
41
+
42
+
43
+ def _parse_array_var(text, name):
44
+ """
45
+ Busca una variable array tipo:
46
+ name = [1, 2, 3];
47
+ o
48
+ name = [1 2 3];
49
+ Devuelve un np.array de ints o None si no está.
50
+ """
51
+ m = re.search(rf'\b{name}\b\s*=.*?\[(.*?)\];', text, re.DOTALL)
52
+ if not m:
53
+ return None
54
+
55
+ inner = m.group(1).strip()
56
+ if not inner:
57
+ return np.array([], dtype=int)
58
+
59
+ # Separar por comas o espacios
60
+ tokens = re.split(r'[\s,]+', inner)
61
+ tokens = [t for t in tokens if t != '']
62
+
63
+ return np.array([int(t) for t in tokens], dtype=int)
64
+
29
65
  #################################################################################
30
66
  # #
31
67
  # JSP #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IGJSP
3
- Version: 1.1.0
3
+ Version: 1.1.1
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=nSPgsVbpR5YydbrkIOhkGmXbFCnkaIAkRu-ok-_BJpY,47603
1
+ IGJSP/generador.py,sha256=vpopW1e8zwZ5H69uvCSY28KJuP-XGNM6VQPKCTawiAs,48598
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.0.dist-info/METADATA,sha256=q-mdPgQhQCvXKTtYbNMsDzgvR-oov4pe27Js_9Oeazo,10609
16
- igjsp-1.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
- igjsp-1.1.0.dist-info/licenses/LICENSE,sha256=f7RDRO-z_nMoooAya7NAb8sXtrHR6WnttYtyUc9fB-c,1116
18
- igjsp-1.1.0.dist-info/RECORD,,
15
+ igjsp-1.1.1.dist-info/METADATA,sha256=JtfzaTnLrHW2GMG__daue2UjaEjh9_0UwgDMFDjVCRI,10609
16
+ igjsp-1.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
+ igjsp-1.1.1.dist-info/licenses/LICENSE,sha256=f7RDRO-z_nMoooAya7NAb8sXtrHR6WnttYtyUc9fB-c,1116
18
+ igjsp-1.1.1.dist-info/RECORD,,
File without changes