aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/problem/Problem.java
blob: 07183eab1bf2bd4d8b7287e74ded71a4f24a5ab0 (plain)
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
package jcgp.backend.modules.problem;

import java.io.File;

import jcgp.backend.function.FunctionSet;
import jcgp.backend.modules.Module;
import jcgp.backend.population.Chromosome;
import jcgp.backend.population.Population;
import jcgp.backend.resources.ModifiableResources;
import jcgp.backend.resources.Resources;

public abstract class Problem implements Module {

	protected FunctionSet functionSet;
	private String fileExtension = ".*";
	private String name = this.getClass().getSimpleName();
	
	public abstract void evaluate(Population population, Resources resources);
	
	public FunctionSet getFunctionSet() {
		return functionSet;
	}
	
	public abstract boolean isPerfectSolution(Chromosome fittest);
	
	public abstract void parse(File file, ModifiableResources resources);
	
	public void setFileExtension(String fileExtension) {
		this.fileExtension = fileExtension;
	}
	
	public String getFileExtension() {
		return fileExtension;
	}
	
	public void setProblemName(String newName) {
		this.name = newName;
	}
	
	public String getProblemName() {
		return name;
	}
	
	@Override
	public String toString() {
		return name;
	}
}