source: java/ecj/cecj/statistics/SimpleCoevolutionaryStatistics.java @ 1305

Last change on this file since 1305 was 193, checked in by Maciej Komosinski, 11 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 991 bytes
Line 
1package cecj.statistics;
2
3import java.util.List;
4
5import cecj.interaction.InteractionResult;
6
7import ec.EvolutionState;
8import ec.vector.DoubleVectorIndividual;
9
10public 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.