// Randomize starting placement private void SelectFirstCity() { Random rand = new Random(); //select _CurrentCity = _CitiesToVisit[rand.Next(0, _CitiesToVisit.Count - 1)]; //place to city _CurrentCity.Receive(this, _CitiesToVisit); }
/// <summary> /// Move Ant to next City /// </summary> /// <returns><c>ACOCity</c> where come.</returns> public ACOCity GoNext() { //if bypass is not over if (!HasFinished()) { //decide wher go next ACOCity cityToGo = MakeDecision(); //leave current _CurrentCity.Release(this, _TabuList); //go to next _CurrentCity = cityToGo; _CurrentCity.Receive(this, _CitiesToVisit); } return(_CurrentCity); }