Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }