Esempio n. 1
0
    public static void Main()
    {
        GAIndividual.adj_matrix = GAUtils.readMatrix(@"d:\graph.txt");
        int nvert = GAIndividual.adj_matrix.Length;         // number of vertices

        GAEvolve.evolveAndMakeMFile(@"d:\ga.m", 1, 400, 200, nvert, 50, 50);
    }
Esempio n. 2
0
    public static void Main(string[] args)
    {
        int[] a = new int[] { 2, 4, 3, 1, 0, 5 };
        int[] b = GAUtils.perm2picklist(a);

        float[][] matrix = GAUtils.readMatrix("graph.txt");
        for (int i = 0; i < matrix.Length; i++)
        {
            Console.WriteLine(GAUtils.array2string(matrix[i]));
        }
    }
Esempio n. 3
0
    public static void main(string[] args)
    {
        GAIndividual.adj_matrix = GAUtils.readMatrix("graph.txt");
        int nvert = GAIndividual.adj_matrix.Length;         // number of vertices

        GAIndividual i1 = new GAIndividual(nvert);
        GAIndividual i2 = new GAIndividual(nvert);

        for (int i = 0; i < 1000; i++)
        {
            Console.WriteLine(new GAIndividual(nvert));
        }
    }
Esempio n. 4
0
    public static void Main()
    {
        GAIndividual.adj_matrix = GAUtils.readMatrix(@"d:\graph.txt");
        int nvert = GAIndividual.adj_matrix.Length;         // number of vertices

        GAPopulation gap = new GAPopulation(100, nvert);

        for (int i = 0; i < 100; i++)
        {
            Console.WriteLine(gap.ind[gap.best_index]);
            gap = GAPopulation.generate(gap, 60, 30);
        }
        Console.WriteLine(gap.ind[gap.best_index]);
    }