source: java/ecj/cecj/archive/ArchivingSubpopulation.java @ 35

Last change on this file since 35 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: 858 bytes
Line 
1        package cecj.archive;
2
3import java.util.ArrayList;
4import java.util.Arrays;
5import java.util.List;
6
7import ec.EvolutionState;
8import ec.Group;
9import ec.Individual;
10import ec.Subpopulation;
11import ec.util.Parameter;
12
13public class ArchivingSubpopulation extends Subpopulation {
14
15        List<Individual> archiveIndividuals;
16
17        @Override
18        public void setup(EvolutionState state, Parameter base) {
19                super.setup(state, base);
20                archiveIndividuals = new ArrayList<Individual>();
21        }
22       
23        @Override
24        public Group emptyClone() {
25                ArchivingSubpopulation subpopulation = (ArchivingSubpopulation) super.emptyClone();
26                subpopulation.archiveIndividuals = archiveIndividuals;
27                return subpopulation;
28        }
29       
30
31        public List<Individual> getArchivalIndividuals() {
32                return archiveIndividuals;
33        }
34       
35        public List<Individual> getIndividuals() {
36                return Arrays.asList(individuals);
37        }
38}
Note: See TracBrowser for help on using the repository browser.