MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SynHandlerBase.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2011 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "Synapse.h"
12 #include "SynHandlerBase.h"
13 
14 static const double RANGE = 1.0e-15;
15 
17 {
19  "activationOut",
20  "Sends out level of activation on all synapses converging to "
21  "this SynHandler"
22  );
23  return &activationOut;
24 }
25 
32 {
34  "numSynapses",
35  "Number of synapses on SynHandler. Duplicate field for num_synapse",
38  );
40  static DestFinfo process( "process",
41  "Handles 'process' call. Checks if any spike events are due for"
42  "handling at this timestep, and does learning rule stuff if needed",
44  static DestFinfo reinit( "reinit",
45  "Handles 'reinit' call. Initializes all the synapses.",
47 
48  static Finfo* processShared[] =
49  {
50  &process, &reinit
51  };
52  static SharedFinfo proc( "proc",
53  "Shared Finfo to receive Process messages from the clock.",
54  processShared, sizeof( processShared ) / sizeof( Finfo* )
55  );
56 
58  static Finfo* synHandlerFinfos[] =
59  {
60  &numSynapses, // Value
61  activationOut(), // SrcFinfo
62  &proc, // SharedFinfo
63  };
64 
65  static string doc[] =
66  {
67  "Name", "SynHandlerBase",
68  "Author", "Upi Bhalla",
69  "Description",
70  "Base class for handling synapse arrays converging onto a given "
71  "channel or integrate-and-fire neuron. This class provides the "
72  "interface for channels/intFires to connect to a range of synapse "
73  "types, including simple synapses, synapses with different "
74  "plasticity rules, and variants yet to be implemented. "
75  };
76  static ZeroSizeDinfo< int > dinfo;
77  static Cinfo synHandlerCinfo (
78  "SynHandlerBase",
80  synHandlerFinfos,
81  sizeof( synHandlerFinfos ) / sizeof ( Finfo* ),
82  &dinfo,
83  doc,
84  sizeof( doc ) / sizeof( string )
85  );
86 
87  return &synHandlerCinfo;
88 }
89 
91 
93 
95 {
96  ;
97 }
98 
100 {
101  ;
102 }
103 
104 void SynHandlerBase::setNumSynapses( unsigned int num )
105 {
106  vSetNumSynapses( num );
107 }
108 
109 unsigned int SynHandlerBase::getNumSynapses() const
110 {
111  return vGetNumSynapses();
112 }
113 
115 {
116  return vGetSynapse( i );
117 }
118 
120 {
121  vProcess( e, p );
122 }
123 
125 {
126  vReinit( e, p );
127 }
128 
129 bool SynHandlerBase::rangeWarning( const string& field, double value )
130 {
131  if ( value < RANGE )
132  {
133  cout << "Warning: Ignored attempt to set " << field <<
134  " of SynHandler " <<
135  // c->target().e->name() <<
136  " to less than " << RANGE << endl;
137  return 1;
138  }
139  return 0;
140 }
uint32_t value
Definition: moosemodule.h:42
void setNumSynapses(unsigned int num)
virtual void vReinit(const Eref &e, ProcPtr p)=0
virtual Synapse * vGetSynapse(unsigned int i)=0
unsigned int getNumSynapses() const
virtual unsigned int vGetNumSynapses() const =0
void reinit(const Eref &e, ProcPtr p)
static const Cinfo * initCinfo()
Synapse * getSynapse(unsigned int i)
static const Cinfo * synHandlerCinfo
Definition: Eref.h:26
virtual void vSetNumSynapses(unsigned int num)=0
virtual ~SynHandlerBase()
bool rangeWarning(const string &field, double value)
static SrcFinfo1< double > * activationOut()
static const double RANGE
virtual void vProcess(const Eref &e, ProcPtr p)=0
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void process(const Eref &e, ProcPtr p)
Definition: Cinfo.h:18
Definition: Finfo.h:12