Пример #1
0
        public Parameter EstimateParameter()
        {
            Parameter  p         = new Parameter();
            ClusterGen generator = new ClusterGen(this);

            if (!generator.partitionTrajectory())
            {
                Console.WriteLine("Unable to partition a trajectory\n");
                return(null);
            }
            if (!generator.estimateParameterValue(ref p))
            {
                Console.WriteLine("Unable to calculate the entropy\n");
                return(null);
            }
            return(p);
        }
Пример #2
0
        public bool ClusterGenerate(double epsParam, int minLnsParam,
                                    double minSegmentLength = 50.0, int MDLCostAdwantage = 25)
        {
            m_parameter.epsParam         = epsParam;
            m_parameter.minLnsParam      = minLnsParam;
            m_parameter.minSegmentLength = minSegmentLength;
            m_parameter.MDLCostAdwantage = MDLCostAdwantage;

            ClusterGen generator = new ClusterGen(this);

            if (m_trajectoryList.Count == 0)
            {
                Console.WriteLine("Load a trajectory data set first");
            }

            // FIRST STEP: Trajectory Partitioning
            if (!generator.partitionTrajectory())
            {
                Console.WriteLine("Unable to partition a trajectory\n");
                return(false);
            }

            // SECOND STEP: Density-based Clustering
            if (!generator.performDBSCAN())
            {
                Console.WriteLine("Unable to perform the DBSCAN algorithm\n");
                return(false);
            }

            // THIRD STEP: Cluster Construction
            if (!generator.constructCluster())
            {
                Console.WriteLine("Unable to construct a cluster\n");
                return(false);
            }

            return(true);
        }