-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
47 lines (41 loc) · 1.44 KB
/
Program.cs
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
using System;
using System.IO;
namespace ReactionDiffusion
{
class Program
{
static void Main(string[] args)
{
//width and height inputs
int width = 20;
int height = 20;
double KillRate = 0.062;
double FeedRate = 0.055;
double dA = 1;
double dB = 0.5;
Console.WriteLine("Hello World!");
//reaction diffusion algorithm controller
ReactionDiffusionController cntrl = new ReactionDiffusionController(width, height, KillRate, FeedRate, dA, dB);
cntrl.AssignBvalues(8, 12, 8, 18);
ReactionDiffusionController temp = cntrl;
// for (int i = 0; i < 2; i++)
// {
// temp.Run(width, height);
// Console.WriteLine("controller diffusiont test:{0}", cntrl.KillRate);
// Console.WriteLine("Cell value:{0}", cntrl.Grid[2, 2].A);
// }
//string format to export .text file for grasshopper
string text = width + ";" + height + ";0";
//write text for each cell of the grid
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
text += "\n" + cntrl.Next[i, j].Color.ToCSV();
}
}
//write text to a file
File.WriteAllText("Result.txt", text);
}
}
}