Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Results structure, add DummySolver
- Loading branch information
1 parent
0f9461c
commit 1529b73
Showing
7 changed files
with
61 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.poshwolf.core; | ||
|
||
public class DummySolver implements Solver { | ||
|
||
public ResultWithOrder solve(TaskDefinition task, ProgressListener listener) { | ||
ResultWithOrder r = new ResultWithOrder(); | ||
|
||
r.setExecutionTimespan(2345); | ||
r.setComputationTime(23.45); | ||
|
||
int[][] o = new int[task.getMachineCount()][task.getJobCount()];; | ||
for (int m = 0; m < task.getMachineCount(); m++) | ||
for (int j = 0; j < task.getJobCount(); j++) | ||
o[m][j] = (m + 1) * (j + 1); | ||
r.setJobOrderForMachines(o); | ||
|
||
return r; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
package com.poshwolf.core; | ||
|
||
|
||
public class ResultWithOrder extends Result { | ||
|
||
// The order of jobs to be executed on each machine | ||
// found by the algorithm | ||
private int[][] jobOrderForMachines; // matrix: machinCount x jobCount | ||
|
||
public int[][] getJobOrderForMachines() { | ||
return jobOrderForMachines; | ||
} | ||
|
||
public void setJobOrderForMachines(int[][] jobOrderForMachines) { | ||
this.jobOrderForMachines = jobOrderForMachines; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/poshwolf/core/ResultWithOrderAndInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
package com.poshwolf.core; | ||
|
||
public class ResultWithOrderAndInput extends ResultWithOrder { | ||
|
||
// The input task definition provided to the solver | ||
private TaskDefinition task; | ||
|
||
|
||
public TaskDefinition getTask() { | ||
return task; | ||
} | ||
|
||
public void setTask(TaskDefinition task) { | ||
this.task = task; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters