public string GetTspNameById(int id) { TspInfo value = null; bool found = allTSPs.TryGetValue(id, out value); return(found ? value.GetName() : "?(" + id + ")"); }
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; }
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); }