コード例 #1
0
ファイル: RMP_Connection.cs プロジェクト: lukastk/EvoSim
        public static RMP_Connection GetConnectionFromGene(RMP_ConnectionGene gene, RMP_Neuron source, RMP_Net net)
        {
            var connection = new RMP_Connection();

            connection.ImprintGene(gene, source, net);

            return(connection);
        }
コード例 #2
0
        public override Gene Clone()
        {
            var gene = new RMP_ConnectionGene(GeneHeritage);

            gene.Target             = Target;
            gene.IsOutputConnection = IsOutputConnection;
            gene.Weight             = Weight;

            return(gene);
        }
コード例 #3
0
ファイル: RMP_Connection.cs プロジェクト: lukastk/EvoSim
        public void ImprintGene(RMP_ConnectionGene gene, RMP_Neuron source, RMP_Net net)
        {
            RMP_Neuron target;

            if (gene.IsOutputConnection)
            {
                target = net.OutputNeurons[gene.Target];
            }
            else
            {
                target = net.HiddenNeurons[gene.Target];
            }

            Source = source;
            Target = target;

            Weight = gene.Weight.Value;
        }
コード例 #4
0
        public RMP_ConnectionGene GetRandomConnection(int target, bool isOutputConnection)
        {
            var gene = new RMP_ConnectionGene();

            double weight;

            if (InhibitoryConnectionChance > Pseudo.Random.NextDouble())
            {
                weight = Pseudo.Random.NextDouble(gene.Weight.Min, 0);
            }
            else
            {
                weight = Pseudo.Random.NextDouble(0, gene.Weight.Max);
            }

            gene.Weight.Value = weight;

            gene.Target             = target;
            gene.IsOutputConnection = isOutputConnection;

            return(gene);
        }