Ejemplo n.º 1
0
        /// <summary>
        /// This method will cluster and analyse a given event collection based
        /// upon a weekly approach.
        /// </summary>
        /// <param name="collection">The EventCollection to be clustered and analysed</param>
        private static void PerformWeekAnalysis(EventCollection collection)
        {
            // Output directory
            String output = InputArguments["output"];

            // Create a Multi-Week Analysis object
            MultiWeekAnalysis multi = new MultiWeekAnalysis();

            multi.AddRange(collection);

            // Obtain the EPS distance value
            double eps = GetEPSInput();

            // Obtain the Minimum Number of Objects per cluster value
            int min = GetMinPointsInput();

            // Cluster the Multi-Week Data
            multi.Cluster(eps, min);

            // Analyse the Multi-Week Data
            multi.AnalyseWeeks();

            // Output the KML file
            String kml_output = GenerateOutputName(".kmz");

            multi.GenerateKMZ(kml_output);

            // Save the results to the output directory
            bool minify = InputArguments.ContainsKey("jsminify") ? true : false;

            multi.CreateWeeklyAnalysisJSON(output, minify);
        }
        public void Initialise()
        {
            // A dictionary of week-events
            Events = new Dictionary <int, EventCollection>();

            // Read in the Week 32 logs
            KMLReader w32_reader = new KMLReader(ROOT_DIR + "data\\L_wk32_drops.kml");

            Events[32] = w32_reader.GetCallLogs();

            // Read in the Week 33 logs
            KMLReader w33_reader = new KMLReader(ROOT_DIR + "data\\L_wk33_drops.kml");

            Events[33] = w33_reader.GetCallLogs();

            // Read in the Week 34 logs
            KMLReader w34_reader = new KMLReader(ROOT_DIR + "data\\L_wk34_drops.kml");

            Events[34] = w34_reader.GetCallLogs();

            // Read in the Week 35 logs
            KMLReader w35_reader = new KMLReader(ROOT_DIR + "data\\L_wk35_drops.kml");

            Events[35] = w35_reader.GetCallLogs();

            // Initialise the Multi-Week Analysis Object
            Analysis = new MultiWeekAnalysis();
            Analysis.AddRange(Events[32]);
            Analysis.AddRange(Events[33]);
            Analysis.AddRange(Events[34]);
            Analysis.AddRange(Events[35]);

            // Cluster the data
            Analysis.Cluster(EPS, MIN_POINTS);

            // Analyse all weeks
            Analysis.AnalyseWeeks();
        }