public void AddConnectionMutation_Test() { Assert.AreEqual(1, mutationLog.ConnectionMutations.Count); mutationLog.AddConnectionMutation(connection2); Assert.AreEqual(2, mutationLog.ConnectionMutations.Count); //The expected key MutationLog.ConnectionMutationKey key = new MutationLog.ConnectionMutationKey(2, 1); Assert.True(mutationLog.ConnectionMutations.ContainsKey(key)); Assert.AreEqual(2, mutationLog.ConnectionMutations[key]); }
public void SetUp() { mutationLog = new MutationLog(); node1 = new NodeGene(1, NodeGeneType.HIDDEN, 0.5f); node2 = new NodeGene(2, NodeGeneType.OUTPUT, 1f); connection1 = new ConnectionGene(1, 2, 0.5f, true, 1); connection2 = new ConnectionGene(2, 1, 1f, false, 2); mutationLog.AddConnectionMutation(connection1); mutationLog.AddNodeMutation(connection1, node1); }