private void UpdateConfigurationFromText(string text) { var lines = text.Split('\n', '\r') .Where(s => !string.IsNullOrEmpty(s)).ToArray(); if (lines == null || lines.Length < 3) { return; } RoutingAlgorithm algorithm = new RoutingAlgorithm(); algorithm.ParseInput(lines[0], lines[1], lines[2]); CreateConfiguration(algorithm.Start, algorithm.End, algorithm.Polygon); }
private RoutingAlgorithm GetAlgorithm() { RoutingAlgorithm algorithm = null; switch (cbmAlgorithm.Text) { case "A*": algorithm = new AStarRoutingAlgorithm(); break; case "Dijkstra": algorithm = new DijkstraRoutingAlgorithm(); break; case "Bidirectional": algorithm = new BidirectionalRoutingAlgorithm(); break; default: break; } return(algorithm); }