private IEnumerator InitWebGL(TSPImporter tsp)
 {
     while (!tsp.loadingComplete)
     {
         yield return(new WaitForSeconds(0.1f));
     }
     Init();
 }
Exemple #2
0
 public void Oliver30AS()
 {
     aac = new AntAlgorithms.AntAlgorithmChooser(1, 2, 0.7, 10);
     aa  = aac.getAlgorithm();
     aa.setCities(TSPImporter.importTsp("oliver30.tsp"));
     aa.init();
     for (int i = 0; i < 2500; i++)
     {
         aa.iteration();
     }
     aa.printBestTour("Oliver30AS");
     Assert.True(true);
 }
Exemple #3
0
 public void Eil51ACS()
 {
     aac = new AntAlgorithms.AntAlgorithmChooser(1, 2, 0.1, 20, 0.9);
     aa  = aac.getAlgorithm();
     aa.setCities(TSPImporter.importTsp("eil51.tsp"));
     aa.init();
     for (int i = 0; i < 1000; i++)
     {
         aa.iteration();
     }
     aa.printBestTour("Eil51ACS");
     Assert.True(true);
 }
Exemple #4
0
 public void Berlin52ACS()
 {
     aac = new AntAlgorithms.AntAlgorithmChooser(1, 2, 0.1, 10, 0.9);
     aa  = aac.getAlgorithm();
     aa.setCities(TSPImporter.importTsp("berlin52.tsp"));
     aa.init();
     for (int i = 0; i < 200; i++)
     {
         aa.iteration();
     }
     aa.printBestTour("berlin52");
     Assert.True(true);
 }
Exemple #5
0
 public void Oliver30ACSWithCustomPara()
 {
     aac = new AntAlgorithms.AntAlgorithmChooser(AntAlgorithms.Mode.antColonySystem, 1, 2, 0.1, 10, 0.9, 0.000088, 0.000088);
     aa  = aac.getAlgorithm();
     aa.setCities(TSPImporter.importTsp("oliver30.tsp"));
     aa.init();
     for (int i = 0; i < 1000; i++)
     {
         aa.iteration();
     }
     aa.printBestTour("Oliver30ACSWithCustomPara");
     Assert.True(true);
 }
    public void InitTSP()
    {
        TspFileName  = PlayerPrefs.GetString("TspName");
        TspFileToUse = TspFileName + ".tsp";

#if UNITY_STANDALONE_WIN
        Debug.Log("Stand Alone Windows");
        Cities = TSPImporter.ImportTsp(TspFileToUse);
        Init();
#endif

#if UNITY_WEBGL || UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
        TSPImporter tsp = new TSPImporter();
        Debug.Log("WebGL or Mobile");
        StartCoroutine(tsp.importTspFromWebWebGL(TspFileToUse));
        StartCoroutine(InitWebGL(tsp));
        Cities = tsp.Cities;
#endif
    }
Exemple #7
0
 public override List <City> Load()
 {
     return(TSPImporter.importTsp("si1032.tsp"));
 }
Exemple #8
0
 public override List <City> Load()
 {
     return(TSPImporter.importTsp("fnl4461.tsp"));
 }
Exemple #9
0
 public override List <City> Load()
 {
     return(TSPImporter.importTsp("dsj1000.tsp"));
 }
Exemple #10
0
 public override List <City> Load()
 {
     return(TSPImporter.importTsp("dantzig42.tsp"));
 }