source: java/ecj/cecj/statistics/CoevolutionaryStatistics.java @ 28

Last change on this file since 28 was 28, checked in by mszubert, 15 years ago

cecj - coEvolutionary Computation in Java with additional games package

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.1 KB
Line 
1package cecj.statistics;
2
3import java.io.File;
4import java.io.IOException;
5import java.util.List;
6
7import cecj.interaction.InteractionResult;
8
9
10import ec.EvolutionState;
11import ec.simple.SimpleStatistics;
12import ec.util.Output;
13import ec.util.Parameter;
14
15public abstract class CoevolutionaryStatistics extends SimpleStatistics {
16        public static final String P_STATISTICS_FILE = "file";
17
18        public int statisticslog;
19
20        public CoevolutionaryStatistics() {
21                statisticslog = 0;
22        }
23
24        public void setup(final EvolutionState state, final Parameter base) {
25                super.setup(state, base);
26
27                File statisticsFile = state.parameters.getFile(base.push(P_STATISTICS_FILE), null);
28
29                if (statisticsFile != null) {
30                        try {
31                                statisticslog = state.output.addLog(statisticsFile, Output.V_NO_GENERAL - 1, false,
32                                                                                                        false, false);
33                        } catch (IOException i) {
34                                state.output.fatal("An IOException occurred while trying to create the log "
35                                                + statisticsFile + ":\n" + i);
36                        }
37                }
38        }
39
40        public abstract void printInteractionResults(EvolutionState state,
41                        List<List<InteractionResult>> result, int subpop);
42
43}
Note: See TracBrowser for help on using the repository browser.