public Synaps(int Id, SynapsDir Dir) { this.Id = Id; this.Dir = Dir; Weight = -0.5f + (0.75f + 0.5f) * (float)Form1.Rand.NextDouble(); Time = Form1.Rand.Next(2, 15); }
int SynapsExist(int Layer, int Source, int Target, SynapsDir Dir) { for (int i = 0; i < Neurons[Layer][Source].Synapses.Count; i++) { Synaps S = Neurons[Layer][Source].Synapses[i]; if (S.Dir == Dir && S.Id == Target) { return(i); } } return(-1); }