Пример #1
0
        private void RegressionTrainingRandomLocation(Object thisShape, EventArgs myEventArgs)
        {
            TrainTimerCount += 1;
            // stop training if you reach specified number of trials
            if (TrainTimerCount == 20)
            {
                TrainTimer.Stop();
                TrainTimer.Dispose();
                MainGrid.ClearShapes();
            }
            else
            {
                // put test shape in random grid location
                Random rnd  = new Random();
                var    freq = rnd.Next(10, 25);
                ClassificationShape.Col   = rnd.Next(0, MainGrid.Cols);
                ClassificationShape.Row   = rnd.Next(0, MainGrid.Rows);
                ClassificationShape.Hertz = freq;
                ClassificationShape.Text  = freq.ToString();
                if (TrainTimerCount != 0)
                {
                    MainGrid.RedrawGrid();
                }

                ClassificationShape.DrawBox();
            }
        }