Example #1
0
    public string GetTspNameById(int id)
    {
        TspInfo value = null;
        bool    found = allTSPs.TryGetValue(id, out value);

        return(found ? value.GetName() : "?(" + id + ")");
    }
Example #2
0
    void Start()
    {
        startPlatform = Resources.Load("Platform") as GameObject;
        startTrigger  = Resources.Load("PlatformTrigger") as GameObject;

        var loader = new PlatformGeneratorLoader();

        generator = loader.LoadAny();
        tsp       = loader.Tsp;
        Debug.Log(String.Format("Use PlatformGenerator #{0}", generator.ID));

        CalculateCorridorValues();
        platformHeight = startPlatform.GetComponent <BoxCollider2D>().size.y;
    }
Example #3
0
    private AntAlgorithm CreateAntAlgorithm()
    {
        Tsp = TspLoader.Instance.SelectRandomTsp();
        List <City> cities = Tsp.Load();

        Debug.Log("Loaded TSP '" + Tsp.GetName() + "' with " + cities.Count + " cities.");

        AntAlgorithm algo = new ASAlgorithm(1, 2, 100, 6);

        algo.setCities(cities);
        algo.init();

        for (int i = 0; i < 5; i++)
        {
            algo.iteration();
        }

        return(algo);
    }