-
Notifications
You must be signed in to change notification settings - Fork 2
/
Population.h
60 lines (46 loc) · 1.23 KB
/
Population.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
52
53
54
55
56
57
58
59
60
/*
* Population.h
*
* Created on: Dec 3, 2016
* Author: rocco
*/
#ifndef POPULATION_H_
#define POPULATION_H_
#include "Individual.h"
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
class Population {
public:
Population();
Population(double setMonies, int numExp);
int getSize();
void copy(Population thisPop);
Individual randomlySelectFromPop();
Individual reproduce(Individual father, Individual mother);
Individual mutate(Individual preMutant);
Individual getHighestIndividual();
Individual* getIndividualAt(int pos);
double getTotalFitnessFromPop();
double getStartingMonies();
int getNumExp();
void runIndividualFitnessAlgorithm();
void generateGeneration0();
void getPopulationsFitnessValues();
void addChildToPos(int pos, Individual thisChild);
void printPop();
void resetGen();
void setGen();
// void *individualRun(void *threadArg);
~Population();
private:
int sizeOfPop = 50; // change size here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Individual* Gen0[50]; // change size here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
double startMonies;
int numExperiments;
};
#endif /* POPULATION_H_ */
// LEFT OFF HERE