protected void UpdateMinPath(IGraph graph) { var isChanged = false; foreach (var ant in Ants) { if (ant.VisitedVetecies.First() == ant.VisitedVetecies.Last() && ant.VisitedVetecies.Count != 1) { var path = graph.CalculatePath(ant.VisitedVetecies); if (path < MinPathLength) { MinPathLength = path; Result = ant.VisitedVetecies; CurrentIterationNoChanges = 0; isChanged = true; } } if (!isChanged) { CurrentIterationNoChanges++; } } }
public Mark(Path path) { Path = path; Pheromone = new Pheromone(); }