Browse Source

Minor updates to documentation

Arthur Bit-Monnot 3 years ago
parent
commit
ddded7da0d
2 changed files with 11 additions and 3 deletions
  1. 7
    3
      doc/src/encodings.md
  2. 4
    0
      src/main/java/jobshop/MainTest.java

+ 7
- 3
doc/src/encodings.md View File

@@ -2,7 +2,11 @@
2 2
 
3 3
 Several encoding and associated utilities are provided in the `jobshop.encodings` package.
4 4
 The abstract class `Encoding` provides a common interface for all encodings.
5
-The only requirement for an encoding is to transform it self into a `Schedule`.
5
+The only requirement for an encoding is to be able to transform itself into a `Schedule`.
6
+
7
+The `jobshop.encodings` package contains a `Task` class that allows representing a particular task of a jobshop instance.
8
+A `Task` object contains a pair of integers `(job, task)` that respectively specify the job in which the task appears, and the index of the task in this job.
9
+For instance the task created with `new Task(0, 2)` would represent the third task of the first job.
6 10
 
7 11
 ## Schedule
8 12
 
@@ -38,7 +42,7 @@ The resource order encoding specifies the order in which each machine will proce
38 42
 
39 43
 Each machine is associated with an array of tasks that specifies the order on which the tasks must be scheduled on the machine.
40 44
 
41
-For instance, the encoding:
45
+For instance, the (completely fictional) encoding:
42 46
 
43 47
  ```
44 48
  machine 0: [(0, 1), (1, 0)]
@@ -46,6 +50,6 @@ For instance, the encoding:
46 50
  machine 2: [(1, 2), (0, 2)]
47 51
  ```
48 52
 
49
- Specifies that the first machine (machine 0) will first process the second task of the first job `(0, 1)` and only when it is finished can start processing the first task of the second job `(1, 0)`.
53
+ specifies that the first machine (machine 0) will first process the second task of the first job `(0, 1)` and only when it is finished can start processing the first task of the second job `(1, 0)`.
50 54
 
51 55
  Unlike `JobNumbers`, the `ResourceOrder` encoding might represent invalid solutions. In this case, its `toSchedule()` method will return an empty result.

+ 4
- 0
src/main/java/jobshop/MainTest.java View File

@@ -3,6 +3,7 @@ package jobshop;
3 3
 import jobshop.encodings.JobNumbers;
4 4
 import jobshop.encodings.ResourceOrder;
5 5
 import jobshop.encodings.Schedule;
6
+import jobshop.encodings.Task;
6 7
 
7 8
 import java.io.IOException;
8 9
 import java.nio.file.Paths;
@@ -35,9 +36,12 @@ public class MainTest {
35 36
 
36 37
             Schedule manualSchedule = new Schedule(instance);
37 38
             // TODO: encode the same solution
39
+            //manualSchedule.setStartTime(....);
38 40
 
39 41
             ResourceOrder manualRO = new ResourceOrder(instance);
40 42
             // TODO: encode the same solution
43
+            //manualRO.addTaskToMachine(..., new Task(..., ...));
44
+
41 45
         } catch (IOException e) {
42 46
             e.printStackTrace();
43 47
             System.exit(1);

Loading…
Cancel
Save