Ejemplo n.º 1
0
 public List <PathGrid> GetListOfPathGridForRefreshGrid(int pointPerCluster, List <PathGrid> gridData)
 {
     return(gridData.Select((p, index) =>
                            new PathGrid
     {
         RowNumber = ++index,
         PathName = $"مسیر شماره - {index}",
         TemporaryId = Guid.NewGuid(),
         Checked = p.Checked,
         ToziZamaniPishfarz = p.ToziZamaniPishfarz,
         BazeZamaniTour = p.BazeZamaniTour,
         PointClusterCoordinates = p.PointClusterCoordinates,
         PointsPerCluster = p.PointClusterCoordinates.Count,
         GradeAvaliyeBazar = p.PointClusterCoordinates.Average(a => a.PotansielAvalie),
         Enheraf = pointPerCluster - p.PointClusterCoordinates.Count,
         OriginDestinationDistance = Math.Round((KdTreeHelper.GetDistanceCoordinate(p.PointClusterCoordinates.First(), p.PointClusterCoordinates.Last()) / 1000), 2)    //convert to kilometer
     }).ToList());
 }
Ejemplo n.º 2
0
 public IEnumerable <PathGrid> GetListOfPathGrid(PathFinderIndexViewModel viewModel, List <PointCluster> pointClusters)
 {
     return(pointClusters.Select((p, index) =>
                                 new PathGrid
     {
         RowNumber = ++index,
         PathName = $"مسیر شماره - {index}",
         IdPlaceTree = p.IdPlaceTree,
         TemporaryId = Guid.NewGuid(),
         Checked = false,
         ToziZamaniPishfarz = viewModel.DefaultTimeDistribution,
         BazeZamaniTour = viewModel.TourTimeSpan,
         PointClusterCoordinates = p.PointClusterCoordinates,
         PointsPerCluster = p.PointClusterCoordinates.Count,
         GradeAvaliyeBazar = p.PointClusterCoordinates.Average(a => a.PotansielAvalie),
         Enheraf = viewModel.PointsOnPath - p.PointClusterCoordinates.Count,
         OriginDestinationDistance = Math.Round((KdTreeHelper.GetDistanceCoordinate(p.PointClusterCoordinates.First(), p.PointClusterCoordinates.Last()) / 1000), 2)    //convert to kilometer
     }));
 }