41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading;
|
|
|
|
namespace SharpPropagation
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Console.WriteLine("********** Sharp Propagation (Console) 2022 **********");
|
|
Random random = new Random();
|
|
Size populationSize = new Size(1000,1000);
|
|
Population peoples = new Population(populationSize,random,10,10,5);
|
|
peoples.SetDisease(new Disease(random,20,10,5,"Chick Chicken"));
|
|
//peoples.Display();
|
|
Console.WriteLine($"Propagation started with {populationSize.Width} x {populationSize.Height} humans ({populationSize.Width*populationSize.Height})");
|
|
int[] stats;
|
|
int steps = 0;
|
|
// 0:normal 1:infected
|
|
while(true)
|
|
{
|
|
steps++;
|
|
stats = peoples.Propagate();
|
|
Console.WriteLine($"Infecteds: {stats[1]} Immunes: {stats[2]} Deads: {stats[3]}");
|
|
if (stats[1] == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
//peoples.Display();
|
|
Console.WriteLine($"Propagation finished in {steps}");
|
|
//Console.ReadKey();
|
|
}
|
|
}
|
|
}
|