-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCHeSC.java
37 lines (28 loc) · 970 Bytes
/
CHeSC.java
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
import AbstractClasses.HyperHeuristic;
import AbstractClasses.ProblemDomain;
public class CHeSC extends HyperHeuristic {
private String name = "CHeSC HyperHeuristic";
public CHeSC(long seed, long timeLimit, ProblemDomain problem){
super(seed);
setTimeLimit(timeLimit);
loadProblemDomain(problem);
}
public void startTimer() {
//starts the timer, and then calls the solve() method
run();
}
//empty method to be called by run()
//the algorithm must be implemented on the python side
public void solve(ProblemDomain problem) {}
//exposes the protected hasTimeExpired method
//this method does NOT account for the time elapsed in python
public boolean hasRuntimeExpired() {
return hasTimeExpired();
}
public void setName(String name) {
this.name = name;
}
public String toString() {
return name;
}
}