コード例 #1
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public static Node NewNode()
            {
                Node node = new Node();

                node.bias      = AiMath.RandomRange(-1f, 1f);
                node.inovation = ++_inovation;
                return(node);
            }
コード例 #2
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public Node Mutated()
            {
                Node node = new Node();

                node.bias      = bias + AiMath.RandomRange(-0.1f, 0.1f);
                node.inovation = _inovation;
                return(node);
            }
コード例 #3
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public Axon Mutated()
            {
                Axon axon = new Axon();

                axon.weight   += AiMath.RandomRange(-0.1f, 0.1f);
                axon.A         = A;
                axon.B         = B;
                axon.inovation = inovation;
                return(axon);
            }
コード例 #4
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public static Axon NewAxon(int range)
            {
                range = Math.Max(1, range);
                Axon axon = new Axon();

                axon.weight    = AiMath.RandomRange(-1f, 1f);
                axon.A         = AiMath.random.Next(0, range);
                axon.B         = AiMath.random.Next(0, range);
                axon.inovation = ++_inovation;
                return(axon);
            }
コード例 #5
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public Node Clone()
            {
                Node node = new Node();

                if (AiMath.PercentChance(mutationChance))
                {
                    node.bias = bias + AiMath.RandomRange(-0.1f, 0.1f);
                }
                else
                {
                    node.bias = bias;
                }

                node.inovation = _inovation;
                return(node);
            }
コード例 #6
0
ファイル: DNA.cs プロジェクト: GorkemSvn/AILibrary
            public Axon Clone()
            {
                Axon axon = new Axon();

                if (AiMath.PercentChance(mutationChance))
                {
                    axon.weight = weight + AiMath.RandomRange(-0.1f, 0.1f);
                }
                else
                {
                    axon.weight = weight;
                }

                axon.A         = A;
                axon.B         = B;
                axon.inovation = inovation;
                return(axon);
            }