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