Beispiel #1
0
        protected void CreateBlobs()
        {
            this.BlobMap = new Dictionary <District, CreateContinents.Blob>();
            List <District> list = new List <District>(from d in base.Context.Districts.Values
                                                       where d.Content != District.Contents.WasteNS
                                                       where d.Content != District.Contents.WasteEW
                                                       select d);
            AdHocGraph <District>    graph         = new AdHocGraph <District>(list);
            RandomScatter <District> randomScatter = new RandomScatter <District>(graph);

            randomScatter.Randomizer = base.Context.Randomizer;
            randomScatter.Shots      = Math.Min(list.Count, 500);
            randomScatter.Execute();
            SeedGrower <District, CreateContinents.Blob> seedGrower = new SeedGrower <District, CreateContinents.Blob>(graph)
            {
                Randomizer = base.Context.Randomizer,
                Blank      = null
            };

            foreach (District key in randomScatter.Impacts)
            {
                seedGrower.Seeds.Add(key, new CreateContinents.Blob(this.BlobMap));
            }
            seedGrower.Execute();
            for (int i = 0; i < seedGrower.Graph.Nodes; i++)
            {
                District district          = seedGrower.Graph.Node(i);
                CreateContinents.Blob blob = seedGrower.SeededGraph[i];
                this.BlobMap.Add(district, blob);
                blob.Districts.Add(district);
            }
            this.CoreBlobs = new List <CreateContinents.Blob>(this.BlobMap.Values.Distinct <CreateContinents.Blob>());
        }
        public static void DoRandom()
        {
            RandomScatter rs = new RandomScatter(new TimeSpan(0, 0, 1));

            foreach (DateValuePair dvp in lDVP)
            {
                List <DateValuePair> lDVPOutput = rs.Push(dvp);
                foreach (DateValuePair dvpOutput in lDVPOutput)
                {
                    System.Console.WriteLine("{0:S} - {1:S}", dvpOutput.Date.ToString("hh:mm:ss.ffff"), dvpOutput.Value.ToString());
                }
            }
        }