示例#1
0
    private void ActivationFunctionMutation()
    {
        string   debugMsg = "ActivationFunctionMutation";
        int      nodeRoll = Random.Range(0, Nodes.Count);
        NodeGene ng       = Nodes[nodeRoll];

        if (ng == null)
        {
            throw new System.Exception("Node not found! " + nodeRoll);
        }
        FTYPE fTYPERoll = ActivationFunctions.RandomFTYPE();

        if (fTYPERoll != ng.fTYPE)
        {
            debugMsg += " - Changing node " + nodeRoll + " from " + ng.GetFTYPE() + " to " + fTYPERoll;
            ng.SetFTYPE(fTYPERoll);
        }
        else
        {
            debugMsg += " - Not changing node. Random node selection was same as previous function type";
        }
        if (ArtGallery.DEBUG_LEVEL > ArtGallery.DEBUG.NONE)
        {
            Debug.Log(debugMsg);
        }
    }
示例#2
0
 private void GenerateCPPN()
 {
     foreach (NodeGene node in geno.Nodes)
     {
         node.fTYPE = ActivationFunctions.RandomFTYPE();
     }
 }
示例#3
0
 void GenerateCPPN()
 {
     foreach (NodeGene node in cppnTest.Nodes)
     {
         node.fTYPE = ActivationFunctions.RandomFTYPE();
     }
     cppn = new TWEANN(cppnTest);
 }
示例#4
0
 public void SpliceMutation()
 {
     //HACK just doing random ftypes for now (selected from active functions) we may want this to optionally use the parent function
     SpliceMutation(ActivationFunctions.RandomFTYPE());
 }