Exemplo n.º 1
0
        CalculateNetDepth(CGenome genome)
        {
            int maxDepth = 0;

            for (int i = 0; i < genome.NumNeurons(); i++)
            {
                for (int j = 0; j < vecSplits.Count; j++)
                {
                    SplitDepth split = vecSplits[i];
                    if (genome.SplitY(i) == split.value &&
                        split.depth > maxDepth)
                    {
                        maxDepth = split.depth;
                    }
                }
            }

            return(maxDepth + 2);
        }
Exemplo n.º 2
0
        MutateBaby(CGenome baby)
        {
            if (baby.NumNeurons() < _params.MaxPermittedNeurons)
            {
                baby.AddNeuron(_params.ChanceAddNode, innovation,
                               _params.NumTriesToFindOldLink);
            }

            baby.AddLink(_params.ChanceAddLink,
                         _params.ChanceAddRecurrentLink, innovation,
                         _params.NumTriesToFindLoopedLink,
                         _params.NumAddLinkAttempts);

            baby.MutateWeights(_params.MutationRate,
                               _params.ChanceWeightReplaced,
                               _params.MaxWeightPerturbation);

            baby.MutateActivationResponse(_params.ActivationMutationRate,
                                          _params.MaxActivationPerturbation);
        }