Ejemplo n.º 1
0
        public void DisplayTest()
        {
            var geneSet   = TicTacToeTests.CreateGeneSet().ToList();
            var fitness   = new Fitness(1, 2, 3, 4);
            var candidate = new Chromosome <Rule, Fitness>(geneSet, fitness, Strategy.None);
            var watch     = Stopwatch.StartNew();

            TicTacToeTests.Display(candidate, watch);
        }
Ejemplo n.º 2
0
        public void MutateAddTest()
        {
            var genes   = new List <Rule>();
            var geneSet = TicTacToeTests.CreateGeneSet();

            Assert.IsTrue(TicTacToeTests.MutateAdd(genes, geneSet));
            Assert.AreEqual(1, genes.Count);
            Assert.IsTrue(TicTacToeTests.MutateAdd(genes, geneSet));
            Assert.AreEqual(2, genes.Count);
        }
        public void CreateGeneTest()
        {
            var genes = TicTacToeTests.CreateGeneSet();

            Assert.AreEqual(35, genes.Length);
        }