blob: 68045b03d0e878bf2c742f4b3825bf34ddf7d2f7 (
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
|
package jcgp.population;
public class Output implements MutableElement {
private Connection source;
private Chromosome chromosome;
private int index;
public Output(Chromosome chromosome, int index) {
this.chromosome = chromosome;
this.index = index;
}
public int calculate() {
return source.getValue();
}
@Override
public void setConnection(Connection newConnection) {
source = newConnection;
chromosome.recomputeActiveNodes();
}
public int getIndex() {
return index;
}
public Connection getSource() {
return source;
}
}
|