Exemple #1
0
        public TravelSalesmanScenarioGenerator(int nodes, float maxPathLength)
        {
            Nodes = nodes;

            DistancesVector = new float[Nodes, Nodes];

            for (int i = 0; i < Nodes; i++)
            {
                for (int j = 0; j < Nodes; j++)
                {
                    DistancesVector[i, j] = DistancesVector[j, i] = RandomGenerator.GetInstance().GetRandom(0, maxPathLength);
                }
            }

            Individual = new TravelSalesmanScenario(DistancesVector, maxPathLength);
        }
Exemple #2
0
 public TravelSalesmanScenarioGenerator(float[,] DistancesVector, int nodes, float maxPathLength)
 {
     Nodes      = nodes;
     Individual = new TravelSalesmanScenario(DistancesVector, maxPathLength);
 }