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
SpikeStats.cs
Go to the documentation of this file.
1 namespace SpikingNeuronNetwork.Lib
2 {
3  using System;
4  using System.Text;
5 
9  public class SpikeStats : IComparable
10  {
14  public NeuronState PreSpikeState { get; set; }
15 
19  public NeuronState PostSpikeState { get; set; }
20 
24  public double Weight { get; set; }
25 
29  public Synapse Synapse { get; set; }
30 
37  public override string ToString()
38  {
39  var stringBuilder = new StringBuilder();
40  stringBuilder.AppendLine("---> Spike Time: " + Synapse + " at " + PreSpikeState.Time);
41  stringBuilder.AppendLine("--->Pre -Spike Phase: " + PreSpikeState.StateVariable);
42  stringBuilder.AppendLine("--->Post-Spike Phase: " + PostSpikeState.StateVariable);
43  stringBuilder.Append("--->Weight: " + Weight);
44  return stringBuilder.ToString();
45  }
46 
55  public int CompareTo(object obj)
56  {
57  if (obj == null) return 1;
58 
59  var otherSpikeStats = obj as SpikeStats;
60  if (otherSpikeStats != null)
61  return PreSpikeState.Time.CompareTo(otherSpikeStats.PreSpikeState.Time);
62  throw new ArgumentException("Object is not a SpikeStats");
63  }
64  }
65 }
override string ToString()
Returns a System.String that represents this instance.
Definition: SpikeStats.cs:37
The spike statistics class
Definition: SpikeStats.cs:9
int CompareTo(object obj)
Compares the current instance with another object of the same type and returns an integer that indica...
Definition: SpikeStats.cs:55