コード例 #1
0
 private void DoInitNewRun()
 {
     if (population != null) RemoveBestHandler();
     population = populationFactory.Create(
         Network, 
         NeuralNetworkTest.Create("0.0 = 1.0\r\n1.0 = 0.0"), // TODO: Remove this shit.
         out bodyFactory);
     AddBestHandler();
     bestBody = null;
     populationInitialized = false;
 } 
コード例 #2
0
 void OnBestBodyArrived(object sender, BestBodyArrivedToGroupEventArgs<DNASequence<double>, AdjustedNetworkBody<NeuralNetwork>> e)
 {
     lock (SyncRoot)
     {
         var body = e.Body as AdjustedNeuralNetworkBody;
         Debug.Assert(body != null);
         if (bestBody == null || body.Error < bestBody.Error)
         {
             bestBody = body;
         }
     }
 }