Spiking Neuron Network Simulator  1.0
Simulation and training of spiking neuron networks, primarily theta neurons
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
Synapse.cs
Go to the documentation of this file.
1 namespace SpikingNeuronNetwork.Lib
2 {
6  public class Synapse
7  {
14  public int InputNeuronIndex { get; set; }
15 
22  public int OutputNeuronIndex { get; set; }
23 
29  public Synapse(int inputNeuronIndex, int outputNeuronIndex)
30  {
31  InputNeuronIndex = inputNeuronIndex;
32  OutputNeuronIndex = outputNeuronIndex;
33  }
34 
41  public override string ToString()
42  {
43  return "(" + InputNeuronIndex + "->" + OutputNeuronIndex + ")";
44  }
45 
51  public override bool Equals(object obj)
52  {
53  if (ReferenceEquals(null, obj)) return false;
54  if (ReferenceEquals(this, obj)) return true;
55  if (obj.GetType() != GetType()) return false;
56  return ((Synapse)obj).InputNeuronIndex == InputNeuronIndex && ((Synapse)obj).OutputNeuronIndex == OutputNeuronIndex;
57  }
58 
63  public override int GetHashCode()
64  {
65  unchecked
66  {
67  return (InputNeuronIndex * 397) ^ OutputNeuronIndex;
68  }
69  }
70  }
71 }
override int GetHashCode()
Returns a hash code representing the synapse
Definition: Synapse.cs:63
override string ToString()
Returns a System.String that represents this instance.
Definition: Synapse.cs:41
Synapse(int inputNeuronIndex, int outputNeuronIndex)
Creates a new instance of the synapse class
Definition: Synapse.cs:29
override bool Equals(object obj)
Returns a bool indicating whether the synapse is equal to an object
Definition: Synapse.cs:51