-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
122 lines (69 loc) · 2.07 KB
/
main.cpp
File metadata and controls
122 lines (69 loc) · 2.07 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <stdlib.h>
#include <time.h>
#include <random>
#include <vector>
#include <fstream>
#include <string>
#include <sstream>
#include <iomanip>
#include <iostream> // std::cout
#include <algorithm> // std::sort
#include <vector> // std::vector
#include "Class_Neuron.h"
#include "Class_NeuralNetwork.h"
#include "statistic.h"
using namespace std;
double** getMatrix(int N);
int main(){
int N;
double mu, sigma, theta, C;
string esp;
cout << "insert N (number of neurons)" << endl;
cin >> N;
cout << "insert mu (drift)" << endl;
cin >> mu;
cout << "insert sigma (noise intensity)" << endl;
cin >> sigma;
cout << "insert theta (membrane time)" << endl;
cin >> theta;
cout << "insert C (threshold)" << endl;
cin >> C;
NeuralNetwork NN1(N, mu, sigma, theta, C ); // N , mu, sigma ,theta, C (threshold)
// Uncomment next line if you want a neuron to have a different mu
//NN1.getNeur(1)->setMu(2);
//JUMP MODEL
cout << "insert the jump matrix " << endl;
NN1.createJumpMatrix(getMatrix(N));
// COVARIANCE MODEL
//cout << "insert the covariance matrix " << endl;
//NN1.createCovMatrix(getMatrix(N));
cout << "Name of the experiment" << endl;
cin >> esp;
//NN1.printParam();
//-------------------- FPT
NN1.FPT(10000);
NN1.writeSpikeTimes_FPT();
//--------------------- SPIKE TRAIN
//NN1.spikeTrain(250000, false);
//NN1.writeSpikeTimes_ST(esp);
//Il copia e incolla e' la fonte di ogni nequizia
//ISI_full_3D(NN1.getNeur(0)->getSpikeTimes() , NN1.getNeur(1)->getSpikeTimes(), NN1.getNeur(2)->getSpikeTimes() , esp);
//cout << NN1.getNeur(0) ->getLog().size() << endl;
//cout << NN1.getNeur(1) ->getLog().size() << endl;
NN1.printParam();
//NN1.writeLog();
}// end main
double** getMatrix(int N){
double **K = new double *[N];
for(int i =0; i < N; i++){
K[i] = new double[N];
for(int j =0; j < N; ++j){
cout << "Insert element " << i+1 <<"," << j+1 << endl;
cin >> K[i][j];
}
}
return K;
}