job-shop-lib 1.0.0b2__tar.gz → 1.0.0b3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/PKG-INFO +2 -6
  2. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/README.md +1 -5
  3. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/__init__.py +1 -1
  4. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/__init__.py +3 -3
  5. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/__init__.py +6 -1
  6. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/_utils.py +39 -3
  7. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/pyproject.toml +1 -1
  8. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/LICENSE +0 -0
  9. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/_base_solver.py +0 -0
  10. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/_job_shop_instance.py +0 -0
  11. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/_operation.py +0 -0
  12. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/_schedule.py +0 -0
  13. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/_scheduled_operation.py +0 -0
  14. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/benchmarking/__init__.py +0 -0
  15. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/benchmarking/_load_benchmark.py +0 -0
  16. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/benchmarking/benchmark_instances.json +0 -0
  17. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/constraint_programming/__init__.py +0 -0
  18. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/constraint_programming/_ortools_solver.py +0 -0
  19. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/__init__.py +0 -0
  20. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_dispatcher.py +0 -0
  21. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_dispatcher_observer_config.py +0 -0
  22. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_factories.py +0 -0
  23. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_history_observer.py +0 -0
  24. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_optimal_operations_observer.py +0 -0
  25. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_ready_operation_filters.py +0 -0
  26. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/_unscheduled_operations_observer.py +0 -0
  27. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/__init__.py +0 -0
  28. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_composite_feature_observer.py +0 -0
  29. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_duration_observer.py +0 -0
  30. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_earliest_start_time_observer.py +0 -0
  31. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_factory.py +0 -0
  32. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_feature_observer.py +0 -0
  33. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_is_completed_observer.py +0 -0
  34. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_is_ready_observer.py +0 -0
  35. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_is_scheduled_observer.py +0 -0
  36. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_position_in_job_observer.py +0 -0
  37. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/feature_observers/_remaining_operations_observer.py +0 -0
  38. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/__init__.py +0 -0
  39. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/_dispatching_rule_factory.py +0 -0
  40. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/_dispatching_rule_solver.py +0 -0
  41. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/_dispatching_rules_functions.py +0 -0
  42. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/_machine_chooser_factory.py +0 -0
  43. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/dispatching/rules/_utils.py +0 -0
  44. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/exceptions.py +0 -0
  45. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/generation/__init__.py +0 -0
  46. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/generation/_general_instance_generator.py +0 -0
  47. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/generation/_instance_generator.py +0 -0
  48. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/generation/_transformations.py +0 -0
  49. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/generation/_utils.py +0 -0
  50. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/_build_disjunctive_graph.py +0 -0
  51. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/_build_resource_task_graphs.py +0 -0
  52. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/_constants.py +0 -0
  53. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/_job_shop_graph.py +0 -0
  54. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/_node.py +0 -0
  55. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/graph_updaters/__init__.py +0 -0
  56. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/graph_updaters/_graph_updater.py +0 -0
  57. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/graph_updaters/_residual_graph_updater.py +0 -0
  58. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/graphs/graph_updaters/_utils.py +0 -0
  59. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/_multi_job_shop_graph_env.py +0 -0
  60. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/_reward_observers.py +0 -0
  61. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/_single_job_shop_graph_env.py +0 -0
  62. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/reinforcement_learning/_types_and_constants.py +0 -0
  63. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/__init__.py +0 -0
  64. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/gantt/__init__.py +0 -0
  65. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/gantt/_gantt_chart_creator.py +0 -0
  66. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/gantt/_gantt_chart_video_and_gif_creation.py +0 -0
  67. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/gantt/_plot_gantt_chart.py +0 -0
  68. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/graphs/__init__.py +0 -0
  69. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/graphs/_plot_disjunctive_graph.py +0 -0
  70. {job_shop_lib-1.0.0b2 → job_shop_lib-1.0.0b3}/job_shop_lib/visualization/graphs/_plot_resource_task_graph.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: job-shop-lib
3
- Version: 1.0.0b2
3
+ Version: 1.0.0b3
4
4
  Summary: An easy-to-use and modular Python library for the Job Shop Scheduling Problem (JSSP)
5
5
  License: MIT
6
6
  Author: Pabloo22
@@ -60,7 +60,7 @@ See [this](https://colab.research.google.com/drive/1XV_Rvq1F2ns6DFG8uNj66q_rcoww
60
60
  Version 1.0.0 is currently in beta stage and can be installed with:
61
61
 
62
62
  ```bash
63
- pip install job-shop-lib==1.0.0b2
63
+ pip install job-shop-lib==1.0.0b3
64
64
  ```
65
65
 
66
66
  Although this version is not stable and may contain breaking changes in subsequent releases, it is recommended to install it to access the new reinforcement learning environments and familiarize yourself with new changes (see the [latest pull requests](https://github.com/Pabloo22/job_shop_lib/pulls?q=is%3Apr+is%3Aclosed)). There is a [documentation page](https://job-shop-lib.readthedocs.io/en/latest/) for versions 1.0.0a3 and onward.
@@ -89,11 +89,7 @@ Although this version is not stable and may contain breaking changes in subseque
89
89
  - **Agent-Task Graphs**: Encode instances as agent-task graphs (introduced in [ScheduleNet paper](https://arxiv.org/abs/2106.03051)). See [Agent-Task Graph](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/07-Agent-Task-Graph.ipynb).
90
90
  - Build your own custom graphs with the `JobShopGraph` class.
91
91
 
92
- <<<<<<< HEAD
93
92
  - **Gymnasium Environments**: Two environments for solving the problem with graph neural networks (GNNs) or any other method, and reinforcement learning (RL). See [SingleJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/09-SingleJobShopGraphEnv.ipynb) and [MultiJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/10-MultiJobShopGraphEnv.ipynb).
94
- =======
95
- - **Gymnasium Environments**: Two environments for solving the problem with Graph Neural Networks (GNNs) or any other method, and Reinforcement Learning (RL). See [SingleJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/09-SingleJobShopGraphEnv.ipynb) and [MultiJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/10-MultiJobShopGraphEnv.ipynb).
96
- >>>>>>> 031bdf3 ([Docs] Update links in README to point to the correct GitHub URLs for tutorials and examples)
97
93
 
98
94
  <!-- end key features -->
99
95
 
@@ -36,7 +36,7 @@ See [this](https://colab.research.google.com/drive/1XV_Rvq1F2ns6DFG8uNj66q_rcoww
36
36
  Version 1.0.0 is currently in beta stage and can be installed with:
37
37
 
38
38
  ```bash
39
- pip install job-shop-lib==1.0.0b2
39
+ pip install job-shop-lib==1.0.0b3
40
40
  ```
41
41
 
42
42
  Although this version is not stable and may contain breaking changes in subsequent releases, it is recommended to install it to access the new reinforcement learning environments and familiarize yourself with new changes (see the [latest pull requests](https://github.com/Pabloo22/job_shop_lib/pulls?q=is%3Apr+is%3Aclosed)). There is a [documentation page](https://job-shop-lib.readthedocs.io/en/latest/) for versions 1.0.0a3 and onward.
@@ -65,11 +65,7 @@ Although this version is not stable and may contain breaking changes in subseque
65
65
  - **Agent-Task Graphs**: Encode instances as agent-task graphs (introduced in [ScheduleNet paper](https://arxiv.org/abs/2106.03051)). See [Agent-Task Graph](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/07-Agent-Task-Graph.ipynb).
66
66
  - Build your own custom graphs with the `JobShopGraph` class.
67
67
 
68
- <<<<<<< HEAD
69
68
  - **Gymnasium Environments**: Two environments for solving the problem with graph neural networks (GNNs) or any other method, and reinforcement learning (RL). See [SingleJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/09-SingleJobShopGraphEnv.ipynb) and [MultiJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/10-MultiJobShopGraphEnv.ipynb).
70
- =======
71
- - **Gymnasium Environments**: Two environments for solving the problem with Graph Neural Networks (GNNs) or any other method, and Reinforcement Learning (RL). See [SingleJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/09-SingleJobShopGraphEnv.ipynb) and [MultiJobShopGraphEnv](https://github.com/Pabloo22/job_shop_lib/blob/main/docs/source/examples/10-MultiJobShopGraphEnv.ipynb).
72
- >>>>>>> 031bdf3 ([Docs] Update links in README to point to the correct GitHub URLs for tutorials and examples)
73
69
 
74
70
  <!-- end key features -->
75
71
 
@@ -19,7 +19,7 @@ from job_shop_lib._schedule import Schedule
19
19
  from job_shop_lib._base_solver import BaseSolver, Solver
20
20
 
21
21
 
22
- __version__ = "1.0.0-b.2"
22
+ __version__ = "1.0.0-b.3"
23
23
 
24
24
  __all__ = [
25
25
  "Operation",
@@ -8,9 +8,9 @@ The main classes and functions available in this package are:
8
8
  NodeType
9
9
  build_disjunctive_graph
10
10
  build_solved_disjunctive_graph
11
- build_agent_task_graph
12
- build_complete_agent_task_graph
13
- build_agent_task_graph_with_jobs
11
+ build_resource_task_graph
12
+ build_complete_resource_task_graph
13
+ build_resource_task_graph_with_jobs
14
14
 
15
15
  """
16
16
 
@@ -12,6 +12,7 @@
12
12
  IdleTimeReward
13
13
  RenderConfig
14
14
  add_padding
15
+ create_edge_type_dict
15
16
 
16
17
  """
17
18
 
@@ -27,7 +28,10 @@ from job_shop_lib.reinforcement_learning._reward_observers import (
27
28
  IdleTimeReward,
28
29
  )
29
30
 
30
- from job_shop_lib.reinforcement_learning._utils import add_padding
31
+ from job_shop_lib.reinforcement_learning._utils import (
32
+ add_padding,
33
+ create_edge_type_dict,
34
+ )
31
35
 
32
36
  from job_shop_lib.reinforcement_learning._single_job_shop_graph_env import (
33
37
  SingleJobShopGraphEnv,
@@ -47,4 +51,5 @@ __all__ = [
47
51
  "ObservationDict",
48
52
  "add_padding",
49
53
  "MultiJobShopGraphEnv",
54
+ "create_edge_type_dict",
50
55
  ]
@@ -1,6 +1,6 @@
1
1
  """Utility functions for reinforcement learning."""
2
2
 
3
- from typing import TypeVar, Any, Tuple, Optional, Type
3
+ from typing import TypeVar, Any, Type, Literal
4
4
 
5
5
  import numpy as np
6
6
  from numpy.typing import NDArray
@@ -12,9 +12,9 @@ T = TypeVar("T", bound=np.number)
12
12
 
13
13
  def add_padding(
14
14
  array: NDArray[Any],
15
- output_shape: Tuple[int, ...],
15
+ output_shape: tuple[int, ...],
16
16
  padding_value: float = -1,
17
- dtype: Optional[Type[T]] = None,
17
+ dtype: Type[T] | None = None,
18
18
  ) -> NDArray[T]:
19
19
  """Adds padding to the array.
20
20
 
@@ -90,6 +90,42 @@ def add_padding(
90
90
  return padded_array
91
91
 
92
92
 
93
+ def create_edge_type_dict(
94
+ edge_index: NDArray[T], type_ranges: dict[str, tuple[int, int]]
95
+ ) -> dict[tuple[str, Literal["to"], str], NDArray[T]]:
96
+ """Organizes edges based on node types.
97
+
98
+ Args:
99
+ edge_index:
100
+ numpy array of shape (2, E) where E is number of edges
101
+ type_ranges: dict[str, tuple[int, int]]
102
+ Dictionary mapping type names to their corresponding index ranges
103
+ [start, end) in the ``edge_index`` array.
104
+
105
+ Returns:
106
+ A dictionary with keys (type_i, "to", type_j) and values as edge
107
+ indices
108
+ """
109
+ edge_index_dict: dict[tuple[str, Literal["to"], str], NDArray] = {}
110
+ for type_name_i, (start_i, end_i) in type_ranges.items():
111
+ for type_name_j, (start_j, end_j) in type_ranges.items():
112
+ key: tuple[str, Literal["to"], str] = (
113
+ type_name_i,
114
+ "to",
115
+ type_name_j,
116
+ )
117
+ # Find edges where source is in type_i and target is in type_j
118
+ mask = (
119
+ (edge_index[0] >= start_i)
120
+ & (edge_index[0] < end_i)
121
+ & (edge_index[1] >= start_j)
122
+ & (edge_index[1] < end_j)
123
+ )
124
+ edge_index_dict[key] = edge_index[:, mask]
125
+
126
+ return edge_index_dict
127
+
128
+
93
129
  if __name__ == "__main__":
94
130
  import doctest
95
131
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "job-shop-lib"
3
- version = "1.0.0-beta.2"
3
+ version = "1.0.0-beta.3"
4
4
  description = "An easy-to-use and modular Python library for the Job Shop Scheduling Problem (JSSP)"
5
5
  authors = ["Pabloo22 <pablete.arino@gmail.com>"]
6
6
  license = "MIT"
File without changes