Rev | Line | |
---|
[122] | 1 | #include "Population.h" |
---|
| 2 | #include "Generator.h" |
---|
| 3 | #include "Evaluator.h" |
---|
| 4 | #include "GeneticOperators.h" |
---|
| 5 | #include "Selection.h" |
---|
| 6 | #include <time.h> |
---|
| 7 | |
---|
| 8 | #define DEBUG 0 |
---|
| 9 | |
---|
| 10 | /** |
---|
| 11 | * the constructor |
---|
| 12 | * |
---|
| 13 | * @param i the number of chromosomes |
---|
| 14 | * @param g the number of generations the population will evolve |
---|
| 15 | * @param l the number of genes contained by a chromosome |
---|
| 16 | * @param t the input graph of tasks |
---|
| 17 | * @param p the input graph of processors |
---|
| 18 | */ |
---|
| 19 | Population::Population(int i, int g, int l, TaskGraf t, ProcesorGraf p ) |
---|
| 20 | { |
---|
| 21 | no_ind = i; |
---|
| 22 | no_gen = g; |
---|
| 23 | length = l; |
---|
| 24 | tasks = t; |
---|
| 25 | procs = p; |
---|
| 26 | run(); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * method that returns the best chromosome obtained |
---|
| 31 | * |
---|
| 32 | * @return the best chromosome of the current population |
---|
| 33 | */ |
---|
| 34 | Chromosome Population::getBest() |
---|
| 35 | { |
---|
| 36 | return best; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | /** |
---|
| 40 | * method starting the population's evolution |
---|
| 41 | */ |
---|
| 42 | void Population::run(){} |
---|
| 43 | |
---|
| 44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.