Now Creates the directory for the images if it does not already exists

This commit is contained in:
2022-05-04 13:43:23 +02:00
parent c2d54081c2
commit b3957c7f6b
+9 -2
View File
@@ -5,6 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Threading; using System.Threading;
using System.IO;
namespace SharpPropagation namespace SharpPropagation
{ {
@@ -17,9 +18,15 @@ namespace SharpPropagation
Size populationSize = new Size(1000,1000); Size populationSize = new Size(1000,1000);
Population peoples = new Population(populationSize,random,10,10,5); Population peoples = new Population(populationSize,random,10,10,5);
peoples.SetDisease(new Disease(random,20,10,5,"Chick Chicken")); peoples.SetDisease(new Disease(random,20,10,5,"Chick Chicken"));
string ImagesLocation = "Test/"; string ImagesLocation = "./Test/";
//peoples.Display(); //peoples.Display();
// If the directory does not exist, create it
if (!Directory.Exists(ImagesLocation))
{
Directory.CreateDirectory(ImagesLocation);
}
Console.WriteLine($"Propagation started with {populationSize.Width} x {populationSize.Height} humans ({populationSize.Width*populationSize.Height})"); Console.WriteLine($"Propagation started with {populationSize.Width} x {populationSize.Height} humans ({populationSize.Width*populationSize.Height})");
int[] stats; int[] stats;
int steps = 0; int steps = 0;