forked from SynapticWall/SynapticWall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignalVisualizer.pde
73 lines (63 loc) · 2.1 KB
/
SignalVisualizer.pde
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
// public class SignalVisualizer extends Interactive {
// private Plot fPlot;
// private Soma fSoma;
// private Signal fSignal;
// private Slider fScale, fZoom;
// public SignalVisualizer() {
// PVector
// fPlot = new Plot(
// new PVector(0, 0),
// new PVector(width, height),
// null
// );
// }
// private static final float c = 2; // capacitance
// private static final float r = 500; // resistance
// private static final float rc = r * c;
// private static final float ur = -0.5; // reset potential
// private static final float u0 = 0; // resting potential
// private static final float q = 2.3; // total charge
// private static final float tc = -100000;
// private static final float th = 1; // the neuron threshold
// private static final float taus = 500; // time constant
// taus = 1;
// taud = 1;
// taul = 1;
// taut = 1;
// tpeak = 0.7;
// cellt = +1
// private float computeEPS(Signal s) {
// int diff = now - s.fFiringTime;
// if (fLastFired <= s.fFiringTime && s.fFiringTime <= now) {
// return Math.exp(-diff/rc) - Math.exp(-diff/taus);
// }
// if (s.fFiringTime < fLastFired && fLastFired <= now) {
// return Math.exp(-(fLastFired - s.fFiringTime)/taus)*(Math.exp(-timeSinceLastFiring/rc) - Math.exp(-timeSinceLastFiring/taus));
// }
// }
// private float compute() {
// double seps = 0, eps = 0;
// int now = millis();
// int timeSinceLastFiring = now - fLastFired;
// for (int i = fReceivedSignals.size()-1; i >= 0; --i) {
// Signal s = fReceivedSignals.get(i);
// eps = computeEPS(s);
// if (eps <= 0.005) {
// fReceivedSignals.remove(s);
// }
// seps += s.fStrength * eps;
// }
// u(i) = cellt * taud * taul * (u0 + (ur - u0) * exp(-( i - tc) / (R*C)) +q/C * (1/(1-taus/(R*C)) / tpeak)*seps
// }
// public int getType() {
// return -1;
// }
// public void draw() {
// pushStyle();
// fPlot.draw();
// popStyle();
// }
// protected boolean isInBounds(float x, float y) {
// return true;
// }
// }