source: proiecte/GAIIA/Generator.h @ 122

Last change on this file since 122 was 122, checked in by (none), 14 years ago
File size: 1.4 KB
Line 
1#ifndef GENERATOR
2#define GENERATOR
3
4#include "Genetic.h"
5#include "Graf.h"
6#include <vector>
7
8using namespace std;
9
10/**
11* Generator.h
12*
13* Implementation of the random chromosomes generator.
14*/
15
16class Generator
17{
18public:
19      /**
20      * the number of chromosome we need to generate
21      */
22      int no_chromosomes; 
23
24      /**
25      * the tasks graph 
26      */
27      TaskGraf tasks;
28
29      /**
30      * the number of processors we can use
31      */
32      int no_procs;
33
34      /**
35      * the number of chromosomes currently returned
36      */
37      int returned;
38
39      /**
40      * the list of chromosomes currently generated
41      */
42      Chromosome * ch_list;
43
44      /**
45      * the list of floating nodes
46      */
47      vector<int> f_nodes;     
48public:
49
50      /**
51      * The constructor
52      *
53      * @param no_ch the number of chromosomes
54      * @param t the graph of tasks
55      * @param nr_procs the number of processors
56      */
57      Generator(int no_ch = 0 , TaskGraf t = NULL, int nr_procs = 0);
58     
59      /**
60      * Method returning the next chromosome from the list
61      *
62      * @return the next chromosome
63      */
64      Chromosome getNext();
65
66      /**
67      * Method generating the chromosomes list
68      *
69      * @return void
70      */
71      void generate();
72
73      /**
74      * Setter for the list of floating nodes
75      *
76      * @param the list of floating nodes
77      */
78      void setFloatingNodes(vector<int> &float_n);
79};
80
81#endif
Note: See TracBrowser for help on using the repository browser.