public GreedyTSPProcessor(string filename) { _fileReader = new TSPReader(); _edgeProcessor = new EdgeProcessor(); _vertices = _fileReader.ReadTSP(filename); }
public GAProcessor(string filename) { _fileReader = new TSPReader(); _pathProcessor = new PathProcessor(); _vertices = new List <Vertex>(_fileReader.ReadTSP(filename)); ParentGenerationList = new List <List <Vertex> >(); _childGenerationList = new List <List <Vertex> >(); FitnessList = new List <int>(); _rng = new Random(); }
public void ProcessFile(byte[] file) { _vertices.Clear(); var stopwatch = new Stopwatch(); stopwatch.Start(); _vertices = _fileReader.ReadTSP("TSPFile/11PointDFSBFS.tsp"); _treeProcessor = new TreeBuilder(_vertices); DepthFirstSearch(_treeProcessor.TreeHeadNode, new List <int>()); stopwatch.Stop(); CalculationTime = stopwatch.ElapsedMilliseconds; }
public void ProcessFile(string fileDir) { _vertices.Clear(); var stopwatch = new Stopwatch(); stopwatch.Start(); _vertices = _fileReader.ReadTSP(fileDir); _permutationProcessor = new PermutationProcessor(_vertices); _permutationProcessor.Permutation(_vertices.Count); stopwatch.Stop(); CalculationTime = stopwatch.ElapsedMilliseconds; ShortestPath = (int[])_permutationProcessor.ShortestPath.Clone(); ShortestDist = _permutationProcessor.ShortestDistance; }
private void random100tspToolStripMenuItem_Click(object sender, EventArgs e) { _geneticAlgorithmProcessor = new GAProcessor("TSPFile/Random100.tsp"); _vertices.Clear(); if (chrtMain.Series.IndexOf("Random100") == -1) { chrtMain.Series.Add("Random100"); chrtMain.Series["Random100"].ChartType = SeriesChartType.Point; _vertices = _fileReader.ReadTSP("TSPFile/Random100.tsp"); foreach (var vertex in _vertices) { chrtMain.Series["Random100"].Points.AddXY(vertex.x, vertex.y); } } chrtMain.Series["Random100"].ChartArea = "ChartArea1"; }
public void PopulateVertices(string fileDir) { _vertices = _fileReader.ReadTSP(fileDir); }