Add method to access tasks in resource order
このコミットが含まれているのは:
コミット
f6d78491ba
2個のファイルの変更、13行の追加、3行の削除
|
@ -16,12 +16,12 @@ public class MainTest {
|
|||
// load the aaa1 instance
|
||||
Instance instance = Instance.fromFile(Paths.get("instances/aaa1"));
|
||||
|
||||
// builds a solution in the job-numbers encoding [0 1 1 0 0 1]
|
||||
// builds a solution in the job-numbers encoding [0 0 1 1 0 1]
|
||||
JobNumbers enc = new JobNumbers(instance);
|
||||
enc.addTask(0);
|
||||
enc.addTask(1);
|
||||
enc.addTask(1);
|
||||
enc.addTask(0);
|
||||
enc.addTask(1);
|
||||
enc.addTask(1);
|
||||
enc.addTask(0);
|
||||
enc.addTask(1);
|
||||
|
||||
|
|
|
@ -62,6 +62,16 @@ public class ResourceOrder extends Encoding {
|
|||
nextFreeSlot[machine] += 1;
|
||||
}
|
||||
|
||||
/** Returns the i-th task scheduled on a particular machine.
|
||||
*
|
||||
* @param machine Machine on which the task to retrieve is scheduled.
|
||||
* @param taskIndex Index of the task in the queue for this machine.
|
||||
* @return The i-th task scheduled on a machine.
|
||||
*/
|
||||
public Task getTaskOfMachine(int machine, int taskIndex) {
|
||||
return tasksByMachine[machine][taskIndex];
|
||||
}
|
||||
|
||||
/** Exchange the order of two tasks that are scheduled on a given machine.
|
||||
*
|
||||
* @param machine Machine on which the two tasks appear (line on which to perform the exchange)
|
||||
|
|
読み込み中…
新しいイシューから参照