示例#1
0
        public void SelectBlobMissTest()
        {
            var collective = new BlobCollective(1.0, 1.0, 4);

            collective.FindClosest(2.0, 2.0);
            Assert.IsNull(collective.SelectedBlob);
        }
示例#2
0
        public void SelectBlobHitTest()
        {
            var collective = new BlobCollective(1.0, 1.0, 4);

            collective.FindClosest(1.0, 1.1);
            Assert.NotNull(collective.SelectedBlob);
            Assert.True(collective.SelectedBlob.Selected);
        }
示例#3
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);
        }