-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGene.java
More file actions
55 lines (48 loc) · 949 Bytes
/
Gene.java
File metadata and controls
55 lines (48 loc) · 949 Bytes
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
50
51
52
53
54
55
/**
* Generic gene interface.
*/
public interface Gene<T> {
/**
* Set the value of the gene to a specified value.
*
* @param value the value to be set
*/
public void setValue(T value);
/**
* Set the value of the gene to a random value.
*
* @return the randomized value
*/
public T setRandomValue();
/**
* Get the value of the gene.
*
* @return the value of the gene.
*/
public T getValue();
/**
* Calculate and set the fitness of the gene.
*
* @return the calculated fitness
*/
public double setFitness();
/**
* Get the fitness of the gene.
*
* @return the fitness of the gene
*/
public double getFitness();
/**
* Combine this gene's value with another one.
*
* @param value2 the value of the second gene
* @return the combined value
*/
public T combineValues(T value2);
/**
* Mutate this gene's value
*
* @return the mutated value
*/
public T mutateValue();
}