diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-01 23:00:53 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-01 23:00:53 +0100 |
commit | 02fd2bc7059da416937beb1abe67e5ca60379030 (patch) | |
tree | 609341fe10aaa0f2dc45a1e72eba20bd24fb1281 /src/jcgp/population/Population.java | |
parent | a757deacded0d7357a9f68462d3f2051e16004ee (diff) |
Settings pane now actually controls the parameters, not much left to do.
Diffstat (limited to 'src/jcgp/population/Population.java')
-rw-r--r-- | src/jcgp/population/Population.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/jcgp/population/Population.java b/src/jcgp/population/Population.java deleted file mode 100644 index f5e0517..0000000 --- a/src/jcgp/population/Population.java +++ /dev/null @@ -1,45 +0,0 @@ -package jcgp.population; - -import jcgp.JCGP.Resources; - - -public class Population { - - private Chromosome[] chromosomes; - private int fittest; - - public Population(Resources resources) { - chromosomes = new Chromosome[(resources.getInt("popSize"))]; - for (int c = 0; c < chromosomes.length; c++) { - chromosomes[c] = new Chromosome(resources); - } - } - - public Population(Chromosome parent, Resources resources) { - chromosomes = new Chromosome[(resources.getInt("popSize"))]; - // make a clone for safety - this.chromosomes[0] = new Chromosome(parent); - // generate the rest of the individuals - for (int c = 1; c < chromosomes.length; c++) { - chromosomes[c] = new Chromosome(chromosomes[0]); - } - } - - /** - * Returns all chromosomes, parents first, then offspring. - * - * @param index - * @return - */ - public Chromosome getChromosome(int index) { - return chromosomes[index]; - } - - public void setBestIndividual(int index) { - fittest = index; - } - - public Chromosome getBestIndividual() { - return chromosomes[fittest]; - } -} |