Example #1
0
        public void Initialise()
        {
            // A dictionary of week-events
            Events = new EventCollection();

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

            Events.AddRange(w32_reader.GetCallLogs());

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

            Events.AddRange(w33_reader.GetCallLogs());

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

            Events.AddRange(w34_reader.GetCallLogs());

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

            Events.AddRange(w35_reader.GetCallLogs());

            // Initialise the Multi-Product Analysis Object
            Analysis = new MultiProductAnalysis();
            Analysis.AddRange(Events);

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

            // Analyse all weeks
            Analysis.AnalyseProducts();
        }
Example #2
0
        /// <summary>
        /// This method will cluster and analyse a given event collection based
        /// upon a product approach.
        /// </summary>
        /// <param name="collection">The EventCollection to be clustered and analysed</param>
        private static void PerformProductAnalysis(EventCollection collection)
        {
            // Output directory
            String output = InputArguments["output"];

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

            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.AnalyseProducts();

            // 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.CreateProductsAnalysisJSON(output, minify);
        }