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); }
public override Gene Clone() { var gene = new RMP_ConnectionGene(GeneHeritage); gene.Target = Target; gene.IsOutputConnection = IsOutputConnection; gene.Weight = Weight; return(gene); }
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; }
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); }