void inicializarCaminos() { for (int i = 0; i < aList.Count; i++) { aList[i].tomarDecision(s.getVerticeActual().getCentro()); aList[i].getVertice().getRastros().Add(aList[i].getRastro()); } }
void Button4Click(object sender, EventArgs e) { aList.Clear(); limpiarVertices(); int cantidad = Int32.Parse(comboBox1.SelectedItem.ToString()); List <int> idValidos = new List <int>(); for (int i = 0; i < grafo.getVertices().Count; i++) { idValidos.Add(i + 1); } int pos; int d; Random rnd; for (int i = 0; i < cantidad; i++) { rnd = new Random(); pos = rnd.Next(idValidos.Count); d = idValidos[pos]; Agente a = new Agente(grafo.getVertices().Find(m => m.getID() == d), i + 1); idValidos.RemoveAt(pos); aList.Add(a); } rnd = new Random(); pos = rnd.Next(idValidos.Count); d = idValidos[pos]; s = new Senuelo((grafo.getVertices().Find(m => m.getID() == d))); dibujarEspectro(s.getVerticeActual().getCentro(), false); for (int i = 0; i < aList.Count; i++) { dibujarEspectro(aList[i].getVertice().getCentro(), true); } pictureBox1.Refresh(); primera = false; animar(); }