-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation.h
146 lines (93 loc) · 2.9 KB
/
simulation.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef SIMULATION_H
#define SIMULATION_H
#include <sys/stat.h>
#include <sstream>
using namespace std;
#include "main.h"
#include "utility.h"
#include "parameter.h"
#include <CGAL/Object.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/squared_distance_2.h>
#include "MyKernel.h"
#include "MyPointC2_iostream.h"
typedef MyKernel<double> MK;
typedef CGAL::Filtered_kernel_adaptor<MK> K;
typedef CGAL::Delaunay_triangulation_2<K> DT;
typedef K::Point_2 Point;
typedef K::Segment_2 Segment;
typedef K::Ray_2 Ray;
typedef K::Line_2 Line;
typedef DT::Vertex_iterator Vertex_iterator;
typedef DT::Vertex_handle Vertex_handle;
typedef vector<Point> vector_Point;
typedef vector<vector<Point>> vector_Point_2d;
typedef vector<Vertex_handle> vector_Vertex_handle;
typedef vector<vector_Vertex_handle> vector_Vertex_handle_2d;
typedef vector<string> vector_string;
typedef vector<vector_string> vector_string_2d;
class Simulation
{
public:
void Run(int& argc,char** &argv);
void RunMakeInitFile();
void RunGrowingRetina();
Simulation():
param(),
csv_data(),
voronoi(),
delauny()
{ };
private:
Parameter param;
int t;//時間
DT dt;//Delaunay三角形分割
//ドローネ三角形分割上での各点へのハンドル
vector_Vertex_handle_2d vtx;
vector_Vertex_handle_2d vtx_R;
vector_Vertex_handle_2d vtx_L;
vector_Vertex_handle_2d vtx_U;
vector_Vertex_handle_2d vtx_D;
vector_Vertex_handle_2d vtx_RU;
vector_Vertex_handle_2d vtx_RD;
vector_Vertex_handle_2d vtx_LU;
vector_Vertex_handle_2d vtx_LD;
////ファイル出力のためのバッファ
vector<string> str_t;//時間
vector_string_2d str_points;//点の位置
vector<string> str_delauny;//ドローネ辺
vector<string> str_voronoi;//ボロノイ辺
stringstream csv_data;
stringstream voronoi;
stringstream delauny;
void Init();
void InitFirstCell();
void InitPoints();
void InitPoints(vector_Vertex_handle& vtx,const int& N,const double& L, const double& U, int t, double r);
void InitPointsCircle(int i);
void InitPointsForMakeInitFile();
void InitPointsRegular();
void InitPointsRetina();
void InitPointsCheckered();
void DevidePointsCircle();
void DevidePointsStripe();
void DevidePointsRandom();
void DevidePointsRandomRegular();
void InitPeriodicPoints();
void CalcVelocity();
void CalcVelocityByMembrane();
void UpdatePosition();
void Apoptosis();
void Apoptosis(int type, double Pd);
void Ablation();
void CacheVertices();
void CacheEdges();
void FoutData();
void FoutEdges();
void ShowVerticesAll();
void ShowVerticesAllNum();
};
extern string OssFlags();
extern void OutFlags(string filepath=string("gflag.txt"));
#endif