Пример #1
0
        public double DistanceTo(cWell DestinationWell, eDistances IntraHistoDistanceType, eDistances InterHistoDistanceType)
        {
            double Distance = 0;

            cExtendedList ListDistSource = new cExtendedList();
            cExtendedList ListDistDest = new cExtendedList();

            for (int Idxdescriptor = 0; Idxdescriptor < cGlobalInfo.CurrentScreening.ListDescriptors.Count; Idxdescriptor++)
            {
                if (cGlobalInfo.CurrentScreening.ListDescriptors[Idxdescriptor].IsActive() == false) continue;

                switch (IntraHistoDistanceType)
                {
                    case eDistances.EUCLIDEAN:
                        ListDistSource.Add(this.ListSignatures[Idxdescriptor].GetHistovalues().Dist_Euclidean(DestinationWell.ListSignatures[Idxdescriptor].GetHistovalues()));
                        ListDistDest.Add(DestinationWell.ListSignatures[Idxdescriptor].GetValue());

                        Distance = ListDistSource.Dist_Euclidean(ListDistDest);
                        break;
                    case eDistances.MANHATTAN:
                        Distance = ListDistSource.Dist_Manhattan(ListDistDest);
                        break;
                    case eDistances.VECTOR_COS:
                        Distance = ListDistSource.Dist_VectorCosine(ListDistDest);
                        break;
                    case eDistances.BHATTACHARYYA:
                        Distance = ListDistSource.Dist_BhattacharyyaCoefficient(ListDistDest);
                        break;
                    case eDistances.EMD:
                        Distance = ListDistSource.Dist_EarthMover(ListDistDest);
                        break;
                    default:
                        break;
                }

            }

            switch (InterHistoDistanceType)
            {
                case eDistances.EUCLIDEAN:
                    Distance = ListDistSource.Dist_Euclidean(ListDistDest);
                    break;
                case eDistances.MANHATTAN:
                    Distance = ListDistSource.Dist_Manhattan(ListDistDest);
                    break;
                case eDistances.VECTOR_COS:
                    Distance = ListDistSource.Dist_VectorCosine(ListDistDest);
                    break;
                case eDistances.BHATTACHARYYA:
                    Distance = ListDistSource.Dist_BhattacharyyaCoefficient(ListDistDest);
                    break;
                case eDistances.EMD:
                    Distance = ListDistSource.Dist_EarthMover(ListDistDest);
                    break;
                default:
                    break;
            }

            return Distance;
        }