public void Initialise()
        {
            // Create a new KML Reader
              KMLReader reader = new KMLReader(ROOT_DIR + "data\\L_wk32_drops.kml");

              // Read in all call logs
              EventCollection collection = reader.GetCallLogs();
              collection.ForEach(evt => evt.Device = DEVICE);

              // Cluster the call logs
              DBSCAN scan = new DBSCAN(collection);
              scan.Analyse();

              // Initialise the clusters
              Clusters = scan.Clusters;

              // Initialise the analysis
              Analysis = new ProductAnalysis(Clusters, DEVICE);
        }
 public void Initalise()
 {
     // Read in a Sample KML File
       KMLReader reader = new KMLReader(ROOT_DIR + "data\\L_wk32_drops.kml");
       // Obtain all the events
       EventCollection collection = reader.GetCallLogs();
       // Cluster the Events
       DBSCAN scan = new DBSCAN(collection);
       scan.Analyse();
       // Get a copy of the Clustered Events
       Clusters = scan.Clusters;
       // Get a copy of the Noise Events
       Noise = scan.Noise;
       // Make a new TEMP dir
       Directory.CreateDirectory(OUTPUT_DIR);
 }
Exemplo n.º 3
0
        public void AnalyseTest()
        {
            // Setup a new Event Collection
              EventCollection collection = new EventCollection();

              // Add 4 Clusters
              collection.AddRange(GenerateCluster(51.0, 51.1, -21.0, -21.1, 10));
              collection.AddRange(GenerateCluster(41.0, 41.1, -11.0, -11.1, 10));
              collection.AddRange(GenerateCluster(31.0, 31.1, -1.0, -1.1, 10));
              collection.AddRange(GenerateCluster(21.0, 21.1, 1.0, 1.1, 10));

              // Cluster the data
              DBSCAN scan = new DBSCAN(collection, 5);
              scan.Analyse();

              // Ensure that there are 4 clusters
              Assert.AreEqual(4, scan.Clusters.Count);

              // Esnure that there are 10 objects within each cluster
              Assert.AreEqual(10, scan.Clusters[0].Count);
              Assert.AreEqual(10, scan.Clusters[1].Count);
              Assert.AreEqual(10, scan.Clusters[2].Count);
              Assert.AreEqual(10, scan.Clusters[3].Count);
        }
 /// <summary>
 /// This method will initalise the clustering algorithm, in order to cluster
 /// the data set held within this object.
 /// </summary>
 /// <param name="eps">The epsilon value</param>
 /// <param name="min">The minimum number of coordinates per cluster</param>
 public void Cluster(double eps, int min)
 {
     // Cluster the data
       DBscan = new DBSCAN(Events, eps, min);
       DBscan.Analyse();
 }
        public void Initialise()
        {
            // Create a new KML Reader
              KMLReader reader = new KMLReader(ROOT_DIR + "data\\L_wk32_drops.kml");

              // Read in all call logs
              EventCollection collection = reader.GetCallLogs();

              // Cluster the call logs
              DBSCAN scan = new DBSCAN(collection);
              scan.Analyse();

              // Initialise the clusters
              Clusters = scan.Clusters;

              // Initialise the analysis
              Analysis = new WeekAnalysis(Clusters, WEEK);
        }
        public void Initialise()
        {
            // Create a new KML Reader
              KMLReader reader = new KMLReader(ROOT_DIR + "data\\L_wk32_drops.kml");

              // Read in all call logs
              EventCollection collection = reader.GetCallLogs();

              // Cluster the call logs
              DBSCAN scan = new DBSCAN(collection);
              scan.Analyse();

              // Initialise the cluster
              Cluster = new EventCollection(scan.Clusters.OrderBy(col => col.Count).Last());

              // Initialise the Cluster analysis
              Analysis = new DropAnalysis(Cluster);
        }