summaryrefslogtreecommitdiff
path: root/IFactivity.hh
blob: 06a32a6dec61268b6b8448ef9909a2cba3d9096b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
  © Copyright 2008 Randal A. Koene <randalk@netmorph.org>
  
  With design assistance from J. van Pelt & A. van Ooyen, and support
  from the Netherlands Organization for Scientific Research (NWO)
  Program Computational Life Sciences grant CLS2003 (635.100.005) and
  from the EC Marie Curie Research and Training Network (RTN)
  NEURoVERS-it 019247.

  This file is part of NETMORPH.

  NETMORPH is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  NETMORPH is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with NETMORPH.  If not, see <http://www.gnu.org/licenses/>.
*/
// IFactivity.hh
// Randal A. Koene, 20051202
//
// Classes and definitions for basic IF neural network activity.

// Note: I am declaring this file dependent on the spatial compilation
// for 2D or 3D conditions, i.e. producing separate object files. Although
// this may not seem to be an obvious requirement for IFactivity, it may
// be useful if I decide to add some distance dependent activity effect.
// (And it saves me the trouble of having to define a neuron_base class
// that contains non-spatial parts of the neuron class.)

#ifndef __IFACTIVITY_HH
#define __IFACTIVITY_HH

#include "event.hh"

#ifndef __NEURON_HH
class neuron;
#endif
#ifndef __CONNECTION_HH
class connection;
#endif
#ifndef __FIBRE_STRUCTURE_HH
class fibre_segment;
#endif

// The following default value is in micrometers per second
#define DEFAULTUNMYELINATEDSPIKESPEED 1000000.0

class IFspike: public Event {
protected:
  neuron * n;
public:
  IFspike(neuron * _n): n(_n) {}
  IFspike(double _t, neuron * _n): Event(_t), n(_n) {}
  virtual void event();
};

class IFactivity: public Activity {
  // This is an Activity handler for neurons. If this handler is chosen and
  // linked to a neuron through neuron::set_activity(), then activity events
  // of that neuron are treated as activity in an integrate-and-fire (IF)
  // model of a neuron. When Activity is then queued for that neuron, the
  // Event that is added to the Event_Queue is an IFspike, and consequent
  // events that result from the IFspike::event() also involve model choices
  // that suit an integrate-and-fire neuron model.
protected:
  neuron * n;
public:
  IFactivity(neuron * _n): n(_n) {}
  virtual void queue(int eventtype = 0) { eq->add(new IFspike(n)); }
  virtual void queue(double t, int eventtype = 0) { eq->add(new IFspike(t,n)); }
};

class IFabstractedpsp: public Event {
protected:
  connection * c;
public:
  IFabstractedpsp(connection * _c): c(_c) {}
  IFabstractedpsp(double _t, connection * _c): Event(_t), c(_c) {}
  virtual void event();
};

class IFinteractiveaxonspike: public Event {
protected:
  fibre_segment * f;
public:
  IFinteractiveaxonspike(fibre_segment * _f): f(_f) {}
  IFinteractiveaxonspike(double _t, fibre_segment * _f): Event(_t), f(_f) {}
  virtual void event();
};

#endif