using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Mutation
{
    public partial class Form1 : Form
    {
        //v0, v2
        Individual test;
        //v1
        Individual[] population;
        int size = 100;
        int indexIndividual, toMutate = 2;
        public Form1()
        {
            InitializeComponent();
            //testing mutateV0                                                  //DATE: 3.3
            //test = new Individual(original.Width, original.Height);           //STATUS: Successful
            //original.Image = test.TheImage;                                   //PURPOSE: testing mutateV0 with one individual; mutating just one triangle

            //testing mutateV1                                                   //DATE: 3.10
            population = new Individual[size];                                 //STATUS: Successful (but unhappy)
            for (int i = 0; i < size; i++)                                        //PURPOSE: testing mutateV0 with a population; mutating just one triangle
            {
                population[i] = new Individual(original.Width, original.Height);
            }
            indexIndividual = RndNumGen.Next(0, size);
            Console.WriteLine("index individual: " + indexIndividual);
            test = new Individual(population[indexIndividual], original.Width, original.Height);
            original.Image = population[indexIndividual].TheImage;

            //testing mutateV2                                                   //DATE: 3.29
            /*test = new Individual(original.Width, original.Height);            //STATUS: Successful
            original.Image = test.TheImage;*/                                  //PURPOSE: testing mutateV2 with one individual; mutating x number of triangles

            //testing mutateV3                                                   //DATE: 3.31
            /*population = new Individual[size];                                   //STATUS: 
            for(int i = 0; i < size; i++)                                        //PURPOSE: testing mutateV2 with a population; mutating x number of triangles
            {
                population[i] = new Individual(original.Width, original.Height);
            }
            indexIndividual = RndNumGen.Next(0, size);
            Console.WriteLine("index individual: " + indexIndividual);
            test = new Individual(population[indexIndividual], original.Width, original.Height);
            original.Image = test.TheImage;*/
        }

        private void btnClick(object sender, EventArgs e)
        {
            Console.WriteLine("entering click");
            //testing mutateV0
            //test.mutateV0(mutant.Width, mutant.Height);
            //mutant.Image = test.TheImage;

            //testing mutateV1
            test.mutateIndividual(mutant.Width, mutant.Height, 20, 40);
            mutant.Image = test.TheImage;

            //testing mutateV2
            /*test.mutateV2(mutant.Width, mutant.Height, 2);                        //MAKE SURE toMutate IS **NOT** MORE THEN THE NUMBER OF TRIANGLES PER INDIVIDUAL
            mutant.Image = test.TheImage;*/

            //testing mutateV3
            /*test.mutateV2(mutant.Width, mutant.Height, toMutate);
            mutant.Image = test.TheImage;*/

            Console.WriteLine("leaving click");
        }
    }
}
