private void OneGeneration_Tick(object sender, EventArgs e) { if (generationNum == 1) { label10.Text = "Generation Num: " + Convert.ToString(++generationNum); for (int i = 0; i < mobScore.Length; i++) { mobScore[i] = 0; } } if (oneGenerationIteration == mobScore.Length) { Crossbreeding(BestMob(mobScore), BestMob(mobScore), BestMob(mobScore), BestMob(mobScore)); Mutation(); oneGenerationIteration++; OneGeneration.Stop(); GlobalCycle.Start(); return; } WeightsReader(W01, W12, W23, oneGenerationIteration); mobUpIteration = 0; OneMobLifeCycle.Start(); OneGeneration.Stop(); }
private void FirstGeneration_Tick(object sender, EventArgs e) { label10.Text = "Generation num: " + Convert.ToString(generationNum); if (firstGenerationIteration == mobScore.Length) { Crossbreeding(BestMob(mobScore), BestMob(mobScore), BestMob(mobScore), BestMob(mobScore)); Mutation(); firstGenerationIteration++; FirstGeneration.Stop(); OneGeneration.Start(); return; } FillW(W01); FillW(W12); FillW(W23); //WeightsReader(W01, W12, W23, firstGenerationIteration); WeightsWriter(W01, W12, W23, firstGenerationIteration); mobUpIteration = 0; OneMobLifeCycle.Start(); FirstGeneration.Stop(); }