private void SsgaMktForm_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { completedIterationCount++; StepWithUIUpdate(); } else if (e.KeyCode == Keys.Enter) { int i = 0; do { Step(); completedIterationCount++; } while (++i < GlobalSettings.SSGAIterationCount); OnDataArrived(); } if ((e.KeyCode == Keys.Space || e.KeyCode == Keys.Enter) && completedIterationCount == GlobalSettings.SSGAIterationCount) { var winner = new BestSeparator<Entity<MktValueService, MktGenom>>() .Separate(generations.Last().Entites, 1, true).First(); logger.Log(winner.Args, new LogValue { Value = winner.Value }); } }
private void InitializeSeparatorLins() { var bestSeparator = new BestSeparator<MKT_Point>(); var roulette = new Roulette<MKT_Point>(); var tournament = new Tournament<MKT_Point>(); var rang = new Rang<MKT_Point>(); bestSeparatorName = bestSeparator.GetType().Name; separators = new Dictionary<string, ISeparator<MKT_Point>> { {bestSeparatorName, bestSeparator}, {roulette.GetType().Name, roulette}, {tournament.GetType().Name, tournament}, {rang.GetType().Name, rang} }; }