private void Iterate()
        {
            int i = 1;

            MyComponent.Index = i;

            foreach (List <double> sample in MyComponent.DesignMap)
            {
                GHUtilities.ChangeSliders(MyComponent.SlidersList, sample);

                MyComponent.Index = i;
                // If we're taking screen shots, this happens here.

                if (MyComponent.Mode == CaptureComponent.CaptureMode.SaveScreenshot || MyComponent.Mode == CaptureComponent.CaptureMode.Both)
                {
                    if (MyComponent.SSDir == "None")
                    {
                        throw new Exception("No screenshot directory given! Please add valid directory");
                    }

                    BeforeScreenShots();
                    ScreenShot(i);
                    AfterScreenShots();
                    MyComponent.ImagesWritten = "Yes";
                }

                // Write intermediate Screenshots
                if (MyComponent.Mode == CaptureComponent.CaptureMode.SaveCSV || MyComponent.Mode == CaptureComponent.CaptureMode.Both)
                {
                    if (MyComponent.SaveFreq > 0)
                    {
                        if (i % MyComponent.SaveFreq == 0)
                        {
                            WriteProgressToFile(MyComponent.AssembleDMO(MyComponent.DesignMap, MyComponent.ObjValues), MyComponent.CSVDir, MyComponent.CSVFilename, ".csv", i);
                            int Last = i - MyComponent.SaveFreq;
                            System.IO.File.Delete(MyComponent.CSVDir + MyComponent.CSVFilename + "_progress_" + Last.ToString() + ".csv");
                        }
                    }
                }

                i++;
            }



            // If we're saving a CSV, this happens here.
            if (MyComponent.Mode == CaptureComponent.CaptureMode.SaveCSV || MyComponent.Mode == CaptureComponent.CaptureMode.Both)
            {
                WriteOutputToFile(MyComponent.AssembleDMO(MyComponent.DesignMap, MyComponent.ObjValues), MyComponent.CSVDir, MyComponent.CSVFilename, ".csv");
                MyComponent.DataWritten = "Yes";

                if (MyComponent.CSVDir == "None")
                {
                    throw new Exception("No CSV directory given! Please add valid directory");
                }
            }
        }
        private void Iterate()
        {
            int i = 1;

            foreach (List <double> sample in MyComponent.DesignMap)
            {
                GHUtilities.ChangeSliders(MyComponent.SlidersList, sample);

                // If we're taking screen shots, this happens here.

                if (MyComponent.Mode == CaptureComponent.CaptureMode.SaveScreenshot || MyComponent.Mode == CaptureComponent.CaptureMode.Both)
                {
                    BeforeScreenShots();
                    ScreenShot(i);
                    AfterScreenShots();
                    MyComponent.ImagesWritten = "Yes";
                }
                i++;
            }



            // If we're saving a CSV, this happens here.
            if (MyComponent.Mode == CaptureComponent.CaptureMode.SaveCSV || MyComponent.Mode == CaptureComponent.CaptureMode.Both)
            {
                WriteOutputToFile(MyComponent.AssembleDMO(MyComponent.DesignMap, MyComponent.ObjValues), MyComponent.CSVDir, MyComponent.CSVFilename, ".csv");
                MyComponent.DataWritten = "Yes";
            }
        }