private double Precent() { Fall currentFall = new Fall(); double currentDinstance = 0; int errorConter = 0; if (FallPredictionList == null) { return(1); } foreach (FallPrediction item in FallPredictionList) { currentFall = CurrentFallVM.GetFallByPrediction(item.FallPredictionFallKey); if (currentFall == null) { errorConter++; } else { currentDinstance = GetDinstance(item.FallPredictionLocation, currentFall.FallLocation); double temp = Double.Parse(RangeLable.Content.ToString().Substring(0, RangeLable.Content.ToString().Length - 1)); if (currentDinstance > temp) { errorConter++; } } } if (FallPredictionList.Count() == 0) { return(0); } double retValue = (double)errorConter / ((double)FallPredictionList.Count()); return(retValue); }
private double SumErrors(List <FallPrediction> predictionList) { Fall currentFall = new Fall(); double currentDinstance = 0; if (FallPredictionList == null) { return(1); } foreach (FallPrediction item in predictionList) { currentFall = CurrentFallVM.GetFallByPrediction(item.FallPredictionFallKey); if (currentFall == null) { currentDinstance += 10; } else { currentDinstance += GetDinstance(item.FallPredictionLocation, currentFall.FallLocation); } } return(currentDinstance); }