Last change
on this file since 57 was
44,
checked in by mszubert, 15 years ago
|
cecj, framsticks and games packages imported
|
File size:
991 bytes
|
Line | |
---|
1 | package cecj.statistics; |
---|
2 | |
---|
3 | import java.util.List; |
---|
4 | |
---|
5 | import cecj.interaction.InteractionResult; |
---|
6 | |
---|
7 | import ec.EvolutionState; |
---|
8 | import ec.vector.DoubleVectorIndividual; |
---|
9 | |
---|
10 | public class SimpleCoevolutionaryStatistics extends CoevolutionaryStatistics { |
---|
11 | |
---|
12 | @Override |
---|
13 | public void printInteractionResults(EvolutionState state, |
---|
14 | List<List<InteractionResult>> results, int subpop) { |
---|
15 | |
---|
16 | System.out.println("Subpopulation " + subpop + " interactions result:"); |
---|
17 | |
---|
18 | for (int i = 0; i < results.size(); i++) { |
---|
19 | System.out.print("Individual " + i + " : "); |
---|
20 | for (int j = 0; j < results.get(i).size(); j++) { |
---|
21 | System.out.print(results.get(i).get(j) + " "); |
---|
22 | } |
---|
23 | System.out.println(state.population.subpops[subpop].individuals[i].fitness |
---|
24 | .fitnessToStringForHumans()); |
---|
25 | } |
---|
26 | |
---|
27 | System.out.println(""); |
---|
28 | } |
---|
29 | |
---|
30 | public void printIndividualGenome(DoubleVectorIndividual ind) { |
---|
31 | for (int g = 0; g < ind.genomeLength(); g++) { |
---|
32 | System.out.print((int) ind.genome[g] + " "); |
---|
33 | } |
---|
34 | System.out.println(""); |
---|
35 | } |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.