Last change
on this file since 36 was
28,
checked in by mszubert, 16 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
|
Rev | Line | |
---|
[28] | 1 | package cecj.archive; |
---|
| 2 | |
---|
| 3 | import java.util.ArrayList; |
---|
| 4 | import java.util.Arrays; |
---|
| 5 | import java.util.List; |
---|
| 6 | |
---|
| 7 | import ec.EvolutionState; |
---|
| 8 | import ec.Group; |
---|
| 9 | import ec.Individual; |
---|
| 10 | import ec.Subpopulation; |
---|
| 11 | import ec.util.Parameter; |
---|
| 12 | |
---|
| 13 | public 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.