-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathIndividuals.h
51 lines (40 loc) · 1.04 KB
/
Individuals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Individuals.h: A collection of individuals
#ifndef INDIVIDUALS_H
#define INDIVIDUALS_H
#include "BasicDefinitions.h"
#include "Chromosome.h"
#include "Individual.h"
#include <map>
#include <ostream>
using namespace std;
class Individual;
class Individuals
{
public:
// Individuals(): default constructor
// Precondition: None.
// Postcondition: individuals is empty.
Individuals();
~Individuals();
// addIndividual(): adds an Individual object
// Precondition: None.
// Postcondition: ind has been added to individuals
void addIndividual( Individual * ind );
Individual * getIndividual ( size_t id ) { return pedigree[ id ]; }
bool more();
Individual* next();
void begin();
size_t size() { return pedigree.size(); }
void initialize();
void print( ostream& );
void freeMatches();
void freeMarkers();
private:
void permuteMarkerSet(Chromosome *, int, MarkerSet);
long sets;
size_t iter;
// stores the individuals
vector< Individual * > pedigree;
};
#endif
// end Individuals.h