-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExperiment.java
More file actions
49 lines (33 loc) · 1.66 KB
/
Copy pathExperiment.java
File metadata and controls
49 lines (33 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package ssmdp;
import java.io.IOException;
import ssmdp.algorithm.Solution;
import ssmdp.algorithm.ScatterSearch;
import ssmdp.algorithm.ScatterSearch.SSConfig;
import ssmdp.algorithm.constructive.RandomConstructive;
import ssmdp.instance.FormatException;
import ssmdp.instance.Instance;
import ssmdp.instance.InstancesManager;
public class Experiment {
private static final long TIMEOUT_MILLIS = 2 * 1000;
public static void main(String[] args) throws IOException, FormatException {
new Experiment().main();
}
public void main() throws IOException, FormatException {
var instancesManager = new InstancesManager();
var instances = instancesManager.getInstances(0,2);
var manager = new ExperimentManager();
for (var instanceFile : instances) {
Instance instance = instanceFile.loadInstance();
Solution solution;
solution = (new RandomConstructive(instance)).createSolution(TIMEOUT_MILLIS);
manager.addSolution(instance, "Random Constructive", solution);
solution = (new ScatterSearch(instance, SSConfig.WITHOUT_INF)).createSolution(TIMEOUT_MILLIS);
manager.addSolution(instance, "SS without Information", solution);
solution = (new ScatterSearch(instance, SSConfig.WITH_INF)).createSolution(TIMEOUT_MILLIS);
manager.addSolution(instance, "SS with Information", solution);
solution = (new ScatterSearch(instance, SSConfig.WITH_MEMORY)).createSolution(TIMEOUT_MILLIS);
manager.addSolution(instance, "SS with Memory", solution);
}
manager.experimentFinished();
}
}