Exemplo n.º 1
0
        private void InvokeOpenInitDialog()
        {
            var result = _windowDialogService.ShowDialog("", InitDialogViewModel);

            if (result == null || !result.Value)
            {
                return;
            }

            // обработка полученных путей
            var adjacencyMatrix = DataLoaderService.LoadAdjacencyMatrix(InitDialogViewModel.AdjacencyMatrixFilePath);

            _network.AdjacencyMatrix = adjacencyMatrix;


            double[,] direcTravelersMatrix;
            if (InitDialogViewModel.HasDirectTravelersMatrix)
            {
                direcTravelersMatrix = DataLoaderService.LoadDirectTravelersMatrix(InitDialogViewModel.DirectTravelersMatrixFilePath);
            }
            else
            {
                var arrivals   = DataLoaderService.LoadArrivals(InitDialogViewModel.ArrivalsFilePath);
                var departures = DataLoaderService.LoadDepartures(InitDialogViewModel.DeparturesFilePath);
                direcTravelersMatrix = Algorithms.FindCorrespMatrix(adjacencyMatrix, arrivals, departures);
            }

            _network.DirectTravelersMatrix = direcTravelersMatrix;

            DataLoaderService.LoadNodesAtrributes(InitDialogViewModel.NodesPositionsFilePath);
        }
Exemplo n.º 2
0
 private void LoadDemandMatrixFile(string path)
 {
     _dataSource.DemandMatrixFilePath = path;
     _dataSource.DemandMatrix         = DataLoaderService.LoadDirectTravelersMatrix(path);
     IsDemandMatrixCorrect            = true;
 }