Esempio n. 1
0
 /// <summary>
 /// 连接两个神经元
 /// </summary>
 /// <param name="src"></param>
 /// <param name="dst"></param>
 /// <param name="s1">突触实例</param>
 public static void Connect(NeuronBase src, NeuronBase dst, SynapseBase s1)
 {
     s1.Pre_SynapseID  = src.ID;
     s1.Post_SynapseID = dst.ID;
     //添加突触
     dst.Afferent.Add(s1);
     //添加轴突
     src.Axon.Add(s1);
 }
Esempio n. 2
0
        /// <summary>
        /// 连接两个神经元(弃用)
        /// </summary>
        /// <param name="g1">前射的神经元组</param>
        /// <param name="g2">后射的神经元组</param>
        /// <param name="i">前射神经元的GroupID</param>
        /// <param name="j">后射神经元的GroupID</param>
        /// <param name="synapse">突触的实例</param>
        public static void Connect(NeuronGroup <T> g1, NeuronGroup <T> g2, int i, int j, SynapseBase synapse)
        {
            var n1 = g1[i];
            var n2 = g2[j];

            synapse.Pre_SynapseID  = n1.ID;
            synapse.Post_SynapseID = n2.ID;
            //添加突触
            n2.Afferent.Add(synapse);
            //添加轴突
            n1.Axon.Add(synapse);
        }