Beispiel #1
0
        public BenchmarkModel()
        {
            graphModel = new GraphModel();
            algorithms = new List <Tuple <string, IShortestPathAlgorithm> >();

            IGraphReader reader = new GraphReadFake();

            graphModel.ReadGraph(reader);

            algorithms.Add(Tuple.Create <string, IShortestPathAlgorithm>("Дейкстра", new DijkstraModel()));
            algorithms.Add(Tuple.Create <string, IShortestPathAlgorithm>("Флойд", new FloydModel()));

            for (int i = 0; i < algorithms.Count; i++)
            {
                algorithms[i].Item2.Graph = graphModel;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Чтение графа
 /// </summary>
 /// <param name="reader">Стратегия</param>
 public void ReadGraph(IGraphReader reader)
 {
     m_cModel?.ReadGraph(reader);
     m_cShortestPath?.InvalidateAlgorithmData();
 }