Skip to content

Commit

Permalink
Updates to doris and job loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
perara committed Oct 25, 2024
1 parent cbdcf11 commit a09d416
Show file tree
Hide file tree
Showing 8 changed files with 430 additions and 195 deletions.
1 change: 1 addition & 0 deletions jsp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"environment": {


}
},
{
Expand Down
3 changes: 3 additions & 0 deletions jsp/bindings/jobshop_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ NB_MODULE(jobshop, m) {
nb::class_<ManualJobShopGenerator>(m, "ManualJobShopGenerator")
.def_static("generateFromFile", &ManualJobShopGenerator::generateFromFile);




// Bind LivePlotter class
nb::class_<LivePlotter>(m, "LivePlotter")
.def(nb::init<int>())
Expand Down
86 changes: 38 additions & 48 deletions jsp/environments/doris.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
num_jobs:36
num_machines:3
[METADATA END]

[JOB DEPENDENCIES]
# Only jobs with dependencies are listed
# Format: jobIndex: depJobIndex1, depJobIndex2, ...
Expand Down Expand Up @@ -42,63 +41,54 @@ num_machines:3
34:12,13,14
35:24
[JOB DEPENDENCIES END]


[OPERATION DURATIONS]
# Each line represents a job
# The number of operations is now 1 for each job
# Job 0 has 1 operation with duration 49
# Job 1 has 1 operation with duration 64, and so on
49
64
36
12
210
24
10
0
24
0
24
48
60
0
0
48
50
48
24
0
0
0
48
5
0
10
72
36
24
20
10
70
10
10
10
10
# Each line represents job:duration
# Format: jobIndex:duration
0:49
1:64
2:36
3:12
4:210
5:24
6:10
7:1
8:24
9:1
10:24
11:48
12:60
13:1
14:1
15:48
16:50
17:48
18:24
19:1
20:1
21:1
22:48
23:5
24:1
25:10
26:72
27:36
28:24
29:20
30:10
31:70
32:10
33:10
34:10
35:10
[OPERATION DURATIONS END]

[OPERATION DEPENDENCIES]
# Only jobs with dependencies are listed
# Format remains opIndex1:depOpIndex1,depOpIndex2,...

# Job 1 (Operation 1 depends on Operation 0)
#1:1:0

# Job 3 (Operation 1 depends on Operation 0; Operation 2 depends on Operation 1)
#3:1:0;2:1

# Job 5 (Operation 1 depends on Operation 0)
#5:1:0

# Continue similarly for other jobs...
[OPERATION DEPENDENCIES END]
6 changes: 3 additions & 3 deletions jsp/generate_graph.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
dot -Tpdf cmake-build-debug/operation_graph.dot -o operation_graph.pdf
dot -Tpng cmake-build-debug/operation_graph.dot -o operation_graph.png
#!/bin/bash
dot -Tpdf cmake-build-debug-dev/operation_graph.dot -o operation_graph.pdf
dot -Tpng cmake-build-debug-dev/operation_graph.dot -o operation_graph.png
4 changes: 3 additions & 1 deletion jsp/include/job_shop_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ class JobShopEnvironment {
}

[[nodiscard]] bool isDone() const {
return std::all_of(currentState->completedJobs.begin(), currentState->completedJobs.end(), [](bool completed) { return completed; });
return std::all_of(
currentState->completedJobs.begin(),
currentState->completedJobs.end(), [](bool completed) { return completed; });
}

[[nodiscard]] int getTotalTime() const { return totalTime; }
Expand Down
Loading

0 comments on commit a09d416

Please sign in to comment.