Exemplo n.º 1
0
        /// <summary>
        /// This method will create a KMZ file based upon the input clusters, and
        /// the collection of noise. A new internal KML file will be created, along
        /// with a heatmap. The heatmap created will only be for the clusters that
        /// were deemed not to be noise.
        /// Both of these seperate elements will be merged into one KMZ file, at
        /// the given output location.
        /// </summary>
        /// <param name="clusters">An list of EventCollections representing clusters</param>
        /// <param name="noise">An EventCollection of noise</param>
        /// <param name="output">The location to output the KMZ file</param>
        public static void GenerateKMZ(List <EventCollection> clusters, EventCollection noise, String output)
        {
            // Setup a temp directory to do the work in
            String tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            tempDirectory += "\\";
            Directory.CreateDirectory(tempDirectory);

            // Create the KML and heatmap file paths
            String kml     = tempDirectory + "data.kml";
            String heatmap = tempDirectory + "heatmap.png";

            // Generate the heatmap inc the KML if possible
            if (clusters.Count > 0)
            {
                Heatmap map = new Heatmap(clusters);
                map.GenerateHeatMap(heatmap);
                // Generate the KML
                KMLWriter.GenerateKML(clusters, noise, kml, "heatmap.png");
            }
            else
            {
                // Generate the KML on its own (no heatmap)
                KMLWriter.GenerateKML(clusters, noise, kml);
            }
            // Create the GMZ File
            SaveToGMZ(tempDirectory, output);

            // Remove the temp directory
            Directory.Delete(tempDirectory, true);
        }
Exemplo n.º 2
0
        public abstract void IterateStateMachines(); //A définir dans les classes héritées

        private void GenerateStrategyHeatMap()
        {
            //TestGPU.ActionWithClosure();
            sw.Reset();
            sw.Start(); // début de la mesure

            //Génération de la HeatMap

            strategyHeatMap.GenerateHeatMap(preferredZonesList, avoidanceZonesList, forbiddenRectangleList,
                                            strictlyAllowedRectangleList, preferredRectangleList, avoidanceConicalZoneList, preferredSegmentZoneList);

            sw.Stop();
        }