MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SpikeStats Class Reference

#include <SpikeStats.h>

+ Inheritance diagram for SpikeStats:
+ Collaboration diagram for SpikeStats:

Public Member Functions

void addSpike (DataId synIndex, const double time)
 
void addSpike (double v)
 
double getThreshold () const
 
void setThreshold (double thresh)
 
 SpikeStats ()
 
void Vm (double v)
 
void vProcess (const Eref &e, ProcPtr p)
 Virtual func for handling process calls. More...
 
void vReinit (const Eref &e, ProcPtr p)
 
- Public Member Functions inherited from Stats
void doWindowCalculation () const
 
double getMean () const
 
unsigned int getNum () const
 
double getSdev () const
 
double getSum () const
 
unsigned int getWindowLength () const
 
double getWmean () const
 
unsigned int getWnum () const
 
double getWsdev () const
 
double getWsum () const
 
void innerWindowCalculation ()
 
void input (double v)
 
void process (const Eref &e, ProcPtr p)
 
void reinit (const Eref &e, ProcPtr p)
 
void setWindowLength (unsigned int len)
 
 Stats ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from Stats
static const CinfoinitCinfo ()
 

Private Attributes

bool fired_
 
unsigned int numSpikes_
 
double threshold_
 

Detailed Description

Definition at line 12 of file SpikeStats.h.

Constructor & Destructor Documentation

SpikeStats::SpikeStats ( )

Definition at line 81 of file SpikeStats.cpp.

82  : Stats(),
83  numSpikes_( 0 ), threshold_( 0.0 ), fired_( false )
84 { ; }
double threshold_
Definition: SpikeStats.h:43
Stats()
Definition: Stats.cpp:134
unsigned int numSpikes_
Definition: SpikeStats.h:42
bool fired_
Definition: SpikeStats.h:44

Member Function Documentation

void SpikeStats::addSpike ( DataId  synIndex,
const double  time 
)

Inserts an event into the pendingEvents queue for spikes.

Referenced by initCinfo().

+ Here is the caller graph for this function:

void SpikeStats::addSpike ( double  v)

Definition at line 120 of file SpikeStats.cpp.

References numSpikes_.

121 {
122  numSpikes_ ++;
123 }
unsigned int numSpikes_
Definition: SpikeStats.h:42
double SpikeStats::getThreshold ( ) const

Definition at line 129 of file SpikeStats.cpp.

References threshold_.

Referenced by initCinfo().

130 {
131  return threshold_;
132 }
double threshold_
Definition: SpikeStats.h:43

+ Here is the caller graph for this function:

const Cinfo * SpikeStats::initCinfo ( )
static

Definition at line 14 of file SpikeStats.cpp.

References addSpike(), getThreshold(), Stats::initCinfo(), setThreshold(), spikeStatsCinfo, and Vm().

15 {
17  // Field Definitions
19  static ValueFinfo< SpikeStats, double > threshold(
20  "threshold",
21  "Spiking threshold. If Vm crosses this going up then the "
22  "SpikeStats object considers that a spike has happened and "
23  "adds it to the stats.",
26  );
28  // MsgDest Definitions
30 
31  static DestFinfo addSpike( "addSpike",
32  "Handles spike event time input, converts into a rate "
33  "to do stats upon.",
35 
36  static DestFinfo Vm( "Vm",
37  "Handles continuous voltage input, can be coming in much "
38  "than update rate of the SpikeStats. Looks for transitions "
39  "above threshold to register the arrival of a spike. "
40  "Doesn't do another spike till Vm falls below threshold. ",
42 
43  static Finfo* statsFinfos[] = {
44  &threshold, // Value
45  &addSpike, // DestFinfo
46  &Vm, // DestFinfo
47  };
48 
49  static string doc[] =
50  {
51  "Name", "SpikeStats",
52  "Author", "Upi Bhalla Aug 2014",
53  "Description",
54  "Object to do some minimal stats on rate of a spike train. "
55  "Derived from the Stats object and returns the same set of stats."
56  "Can take either predigested spike event input, or can handle "
57  "a continuous sampling of membrane potential Vm and decide if "
58  "a spike has occured based on a threshold. "
59  };
60 
61  static Dinfo< SpikeStats > dinfo;
62  static Cinfo spikeStatsCinfo (
63  "SpikeStats",
65  statsFinfos,
66  sizeof( statsFinfos ) / sizeof ( Finfo* ),
67  &dinfo,
68  doc,
69  sizeof( doc ) / sizeof( string )
70  );
71 
72  return &spikeStatsCinfo;
73 }
double getThreshold() const
Definition: SpikeStats.cpp:129
static const Cinfo * spikeStatsCinfo
Definition: SpikeStats.cpp:75
Definition: Dinfo.h:60
void setThreshold(double thresh)
Definition: SpikeStats.cpp:134
void Vm(double v)
Definition: SpikeStats.cpp:107
static const Cinfo * initCinfo()
Definition: Stats.cpp:21
void addSpike(DataId synIndex, const double time)
Definition: OpFunc.h:27
Definition: Cinfo.h:18
Definition: Finfo.h:12

+ Here is the call graph for this function:

void SpikeStats::setThreshold ( double  thresh)

Definition at line 134 of file SpikeStats.cpp.

References threshold_.

Referenced by initCinfo().

135 {
136  threshold_ = v;
137 }
double threshold_
Definition: SpikeStats.h:43

+ Here is the caller graph for this function:

void SpikeStats::Vm ( double  v)

Definition at line 107 of file SpikeStats.cpp.

References fired_, numSpikes_, and threshold_.

Referenced by initCinfo().

108 {
109  if ( fired_ ) { // Wait for it to go below threshold
110  if ( v < threshold_ )
111  fired_ = false;
112  } else {
113  if ( v > threshold_ ) { // wait for it to go above threshold.
114  fired_ = true;
115  numSpikes_++;
116  }
117  }
118 }
double threshold_
Definition: SpikeStats.h:43
unsigned int numSpikes_
Definition: SpikeStats.h:42
bool fired_
Definition: SpikeStats.h:44

+ Here is the caller graph for this function:

void SpikeStats::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

Virtual func for handling process calls.

Reimplemented from Stats.

Definition at line 90 of file SpikeStats.cpp.

References ProcInfo::dt, Stats::input(), and numSpikes_.

91 {
92  double rate = static_cast< double >( numSpikes_ ) / p->dt;
93  numSpikes_ = 0;
94  Stats::input( rate );
95 }
unsigned int numSpikes_
Definition: SpikeStats.h:42
double dt
Definition: ProcInfo.h:18
void input(double v)
Definition: Stats.cpp:183

+ Here is the call graph for this function:

void SpikeStats::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

Reimplemented from Stats.

Definition at line 97 of file SpikeStats.cpp.

References fired_, numSpikes_, and Stats::vReinit().

98 {
99  Stats::vReinit( e, p );
100  numSpikes_ = 0;
101  fired_ = 0;
102 }
unsigned int numSpikes_
Definition: SpikeStats.h:42
bool fired_
Definition: SpikeStats.h:44
virtual void vReinit(const Eref &e, ProcPtr p)
Definition: Stats.cpp:166

+ Here is the call graph for this function:

Member Data Documentation

bool SpikeStats::fired_
private

Definition at line 44 of file SpikeStats.h.

Referenced by Vm(), and vReinit().

unsigned int SpikeStats::numSpikes_
private

Definition at line 42 of file SpikeStats.h.

Referenced by addSpike(), Vm(), vProcess(), and vReinit().

double SpikeStats::threshold_
private

Definition at line 43 of file SpikeStats.h.

Referenced by getThreshold(), setThreshold(), and Vm().


The documentation for this class was generated from the following files: