예제 #1
0
        public void FindClosestTest()
        {
            var environment = new Environment(0.2, 0.2, 2.6, 1.6);

            var collective = new BlobCollective(1.0, 1.0, 4);

            collective.Split();
            collective.Split();

            collective.Move(1.0);
            collective.Sc(environment);

            var largest   = collective.FindLargest(null);
            var smallest1 = collective.FindSmallest(null);
            var smallest2 = collective.FindSmallest(smallest1);

            var closest = collective.FindClosest(largest);

            Assert.AreSame(smallest2, closest);
        }
예제 #2
0
        public void ScTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var environment = new Environment(0.0, 0.0, 100.0, 100.0);
            var blob        = new Blob(71.0, 67.0, 23.0, 5)
            {
                Force = new Vector(3.0, 3.0)
            };

            blob.Move(3.0);
            blob.Sc(environment);
            blob.DrawSimpleBody(canvas, 1.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }