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
NeuronFiringHistory.cs
Go to the documentation of this file.
1 namespace SpikingNeuronNetwork.Lib
2 {
3  using System.Collections.Generic;
4  using System.Linq;
5 
9  public class NeuronFiringHistory
10  {
14  public int NeuronIndex { get; set; }
15 
19  public SortedSet<SpikeStats> SpikeStats { get; set; }
20 
24  public double StartTime
25  {
26  get
27  {
28  return (SpikeStats != null && SpikeStats.Count > 0) ?
29  SpikeStats.First().PreSpikeState.Time :
30  -1;
31  }
32  }
33 
37  public double EndTime
38  {
39  get
40  {
41  var lastOutputSpikeTime = (OutputSpikes != null && OutputSpikes.Count > 0) ? OutputSpikes.OrderBy(x => x.Time).Last().Time : -1;
42  return (SpikeStats != null && SpikeStats.Count > 0) ?
43  (SpikeStats.Last().PostSpikeState.Time > lastOutputSpikeTime ? SpikeStats.Last().PostSpikeState.Time : lastOutputSpikeTime) :
44  -1;
45  }
46  }
47 
51  public List<Spike> OutputSpikes { get; set; }
52 
58  public static List<int> GetNonFiringNeuronIndices(Dictionary<int, NeuronFiringHistory> neuronFiringHistories)
59  {
60  return neuronFiringHistories.Where(x => x.Value.OutputSpikes.Count == 0).Select(x => x.Key).ToList();
61  }
62  }
63 }
static List< int > GetNonFiringNeuronIndices(Dictionary< int, NeuronFiringHistory > neuronFiringHistories)
Gets a list of indices of neurons that do not produce any output spikes
The spike statistics class
Definition: SpikeStats.cs:9