-
Notifications
You must be signed in to change notification settings - Fork 0
/
Host.h
113 lines (75 loc) · 3.78 KB
/
Host.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//****************************************************************************
//
// class Host
//
//****************************************************************************
#ifndef __HOST_H__
#define __HOST_H__
// ===========================================================================
// Libraries
// ===========================================================================
#include <cstdio>
#include <cstdlib>
// ===========================================================================
// Project Files
// ===========================================================================
#include "Triangle.h"
// ===========================================================================
// Class declarations
// ===========================================================================
class Host
{
public :
// =======================================================================
// Constructors
// =======================================================================
Host(void);
Host(int);
Host(const Host &h2);
// =======================================================================
// Destructor
// =======================================================================
~Host(void);
// =======================================================================
// Accessors: getters
// =======================================================================
double getFitness(unsigned int**);
// =======================================================================
// Accessors: setters
// =======================================================================
// =======================================================================
// Public Methods
// =======================================================================
Triangle* generateTriangles(int whatAmI, int howMany);
unsigned int* triangleProfile(Triangle* triangles, int size_triangles);
unsigned int** matrixGenerator(Triangle* triangles, int size_triangles);
Triangle* randomGenes(void);
void mutation(void);
// Save picture with a matrix of pixel value
void save_picture(unsigned char * pix, char* picture_name);
unsigned char* convert_pixel(unsigned int** mat_host, unsigned int** mat_envt, unsigned int** mat_para);
// Compute the matrix of the 3 profiles and print it
void format_and_save(unsigned int**, int);
unsigned int ** pix_to_mat(char * name_pic, int T) const;
void evolutionTriangles(void);
// Return the percentage of each parasite included in the host profile
double* compParaFitness(void);
// Return the chance each parasite has to be transmitted
double* paraReproductionRate(void);
void evolutionPara(void);
// =======================================================================
// Public Attributes
// =======================================================================
protected :
// =======================================================================
// Protected Methods
// =======================================================================
// =======================================================================
// Protected Attributes
// =======================================================================
int nb_triangles_h;
int nb_triangles_p;
Triangle* host_triangles;
Triangle* paras_triangles;
};
#endif // __HOST_H__