-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsegmodel.h
More file actions
50 lines (39 loc) · 1.18 KB
/
segmodel.h
File metadata and controls
50 lines (39 loc) · 1.18 KB
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
/*
* Anıl Osman TUR - 2017
* 17812602
* Ankara University - Computer Engineering Master
* Complex Networks - Thomas Shelling - Segregtion Model
*
*/
#ifndef SEGMODEL_H
#define SEGMODEL_H
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
class SegModel
{
int matSize = 0, simSeed = 1;
int **SimSurface = NULL;
int **SimChanges = NULL;
unsigned int whiteProbTresh = 0, blackProbTresh = 0;
cv::Mat SimSurfaceImg;
const std::string winName = "SegModel";
// some helper functions
int** create2DSimMatrix(void); //dinamic memory alocation !!note: call after initializing the size
void fill2DSimMatrix(int **p);
void init(); // initialization function
void destroy2Dmatrix(int** &p); // memory freeing
void copyMatrix(int **dest, int **src );
// model decision part
float satisfaction(int x, int y, int race);
void moveOrStay(int i, int j);
// visualizaition part
void makeImage(cv::Mat& img);
void showSimResult();
public:
SegModel(int size, int seed, unsigned int wP, unsigned int bP);
~SegModel();
void simCycle();
void simNCycle(int n);
};
#endif // SEGMODEL_H