public void MyTestInitialize()
 {
     int[,] ribs = new int[6, 2] { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 1, 3 }, { 2, 3 } };
     double[] weights = new double[] { 3, 5, 10, 7, 8, 9 };
     _graph = new UndirectedConnectedGraph(ribs, weights);
     int[] trackPoints = new int[] { 0, 2, 1, 3 };
     _track = new UnclosedTrack(trackPoints, _graph);
 }
 public void MyTestInitialize()
 {
     int[] trackPoints1 = new int[] { 0, 2, 1, 3 };
     int[] trackPoints2 = new int[] { 1, 3, 0, 2 };
     _parent1 = new UnclosedTrack(trackPoints1, _graph);
     _parent2 = new UnclosedTrack(trackPoints2, _graph);
     _child1 = new UnclosedTrack(CountOfAllele, _graph, false);
     _child2 = new UnclosedTrack(CountOfAllele, _graph, false);
     int[,] ribs = new int[6, 2] { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 1, 3 }, { 2, 3 } };
     double[] weights = new double[] { 3, 5, 10, 7, 8, 9 };
     _graph = new UndirectedConnectedGraph(ribs, weights);
 }
        public void MyTestInitialize()
        {
            int[,] ribs = new int[6, 2] { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 1, 3 }, { 2, 3 } };
            double[] weights = new double[] { 3, 5, 10, 7, 8, 9 };
            _graph = new UndirectedConnectedGraph(ribs, weights);

            _parents = new AbstractTrack[CountOfTracks];
            _parents[0] = new UnclosedTrack(new int[] { 0, 1, 3, 2 }, _graph);
            _parents[1] = new UnclosedTrack(new int[] { 1, 0, 2, 3 }, _graph);
            _parents[2] = new UnclosedTrack(new int[] { 2, 0, 3, 1 }, _graph);

            _childs = new AbstractTrack[CountOfTracks];
            _childs[0] = new UnclosedTrack(new int[] { 2, 1, 0, 3 }, _graph);
            _childs[1] = new UnclosedTrack(new int[] { 0, 3, 2, 1 }, _graph);
            _childs[2] = new UnclosedTrack(new int[] { 0, 1, 2, 3 }, _graph);
        }
Ejemplo n.º 4
0
        public Configuration()
        {
            AliasCrossingover = new List<string>();
            AliasMutations = new List<string>();
            AliasSelection = new List<string>();

            ConfigName = "Новая конфигурация";
            AlgMode = AlgorithmMode.Singl;
            CountOfReplays = 1;
            ProbOfCrossingover = 100;
            ProbOfMutation = 100;
            FitnessParam = 10;
            Mutation = new NotRandomMutation();
            AliasMutations.Add(Mutation.GetName());
            Crossingover = new CyclicalCrossingover();
            AliasCrossingover.Add(Crossingover.GetName());
            Selection = new TournamentSelection();
            AliasSelection.Add(Selection.GetName());
            Graph = new UndirectedConnectedGraph(10);
            FitnessFunction = new BestReps((int)FitnessParam);
            Tracks = new AbstractTrack[10];
            Random r = new Random();
            for (int i = 0; i < Tracks.Length; i++)
            {
                int[] points = new int[10];
                for (int j = 0; j < points.Length; j++)
                {
                    points[j] = -1;
                }
                int newRandomChromosome = r.Next(points.Length - 1);
                for (int j = 0; j < points.Length; j++)
                {
                    while (points.Contains(newRandomChromosome))
                    {
                        newRandomChromosome = r.Next(points.Length);
                    }
                    points[j] = newRandomChromosome;
                }
                Tracks[i] = new ClosedTrack(points, Graph);
            }
        }
 public void MyTestInitialize()
 {
     _ribs = new int[6, 2] { { 1, 2 }, { 1, 3 }, { 1, 4 }, { 2, 3 }, { 2, 4 }, { 3, 4 }, };
     _weights = new double[] { 3, 5, 10, 7, 8, 9 };
     _target = new UndirectedConnectedGraph(_ribs, _weights);
 }