Beispiel #1
0
 public GAThread(ManualResetEvent doneEvent, List<List<int>> pop, List<double> fits, Crosser cross, Mutater mutate, Spinner spin)
 {
     fitnesses = new List<double>(fits);
        Pop = new List<List<int>>(pop);
        _doneEvent = doneEvent;
        _cross = cross;
        _mutate = mutate;
        _spin = spin;
 }
Beispiel #2
0
 public GAThread(ManualResetEvent manualResetEvent, List<List<int>> cutPop, List<double> cutFitnesses, Crosser cross, Mutater mutate, Spinner spin, Evaluator Eval)
 {
     // TODO: Complete member initialization
        fitnesses = new List<double>(cutFitnesses);
        Pop = new List<List<int>>(cutPop);
        _doneEvent = manualResetEvent;
        _cross = cross;
        _mutate = mutate;
        _spin = spin;
        _eval = Eval;
 }
Beispiel #3
0
        private void SetupLambdas()
        {
            cross = ((int p1, int p2, ref List<int> child1, ref List<int> child2) =>
               {
                    Cross(p1, p2, ref child1, ref child2);
               });

               mutate = ((ref List<int> chromo) =>
               {
                    Mutate(ref chromo);
               });

               spin = ((ref List<double> fitnesses) =>
               {
                    return Spin(ref fitnesses);
               });
        }