public void OperateTest()
        {
            Selection_Tournament target = new Selection_Tournament(); // TODO: Initialize to an appropriate value
            DoublePoint          p1     = new DoublePoint(10);
            DoublePoint          p2     = new DoublePoint(1);
            DoublePoint          p3     = new DoublePoint(15);
            DoublePoint          p4     = new DoublePoint(17);

            p1.Value = 2;
            p2.Value = 5;
            p3.Value = 324;
            p4.Value = 4;

            PointSet ps = new PointSet(new HashSet <Point>()
            {
                p1, p2, p3, p4
            });
            PointSet ps1 = new PointSet(new HashSet <Point>()
            {
                p1, p2, p3, p4
            });

            PointSet actual;

            actual = target.Operate(ps);
            Assert.IsTrue(actual.Set.Count == ps1.Set.Count / 2);
        }
Esempio n. 2
0
        private void SetByteDefaults()
        {
            Initialization = new ByteInitialization_Regular(10, 5);
            SelectionIF S  = new Selection_Tournament();
            CrossoverIF C  = new ByteCrossover_RandomOR();
            MutationIF  M1 = new ByteMutation_Shifts(1);
            MutationIF  M2 = new ByteMutation_ValueAdded(2);

            Operations.Add(S);
            Operations.Add(C);
            Operations.Add(M1);
            Operations.Add(M2);
        }
        public void Selection_TournamentConstructorTest()
        {
            Selection_Tournament target = new Selection_Tournament();

            Assert.AreEqual(target.Type, OperatorType.Both);
        }