00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CONNECTIONMANAGER_H
00024 #define CONNECTIONMANAGER_H
00025
00026
00027 #include "DBInterface.h"
00028 #include "GlobalVariables.h"
00029 #include "ConnectionHolder.h"
00030 #include "SpikeStreamApplication.h"
00031
00032
00033 #include <qstring.h>
00034 #include <qprogressdialog.h>
00035
00036
00037 #include <map>
00038 #include <string>
00039 using namespace std;
00040
00041
00042
00043
00044
00045
00046
00047 class ConnectionManager {
00048
00049 public:
00050 ConnectionManager(DBInterface* netDBInter, DBInterface* devDBInter);
00051 ~ConnectionManager();
00052 int createConnections(ConnectionHolder);
00053 void deleteConnections(vector<ConnectionHolder>);
00054
00055
00056 private:
00057
00058
00059 DBInterface *networkDBInterface;
00060
00061
00062 DBInterface *deviceDBInterface;
00063
00064
00065 QProgressDialog *progressDialog;
00066
00067
00068
00069 SpikeStreamApplication *spikeStrApp;
00070
00071
00072
00073
00074 ConnectionManager(const ConnectionManager&);
00075
00076 ConnectionManager operator = (const ConnectionManager&);
00077
00078 bool connectionExists(mysqlpp::Query&, unsigned int, unsigned int);
00079 void createOffCentreOnSurroundConns(ConnectionHolder&, int&);
00080 void createOnCentreOffSurroundConns(ConnectionHolder&, int&);
00081 void createSIMNOSComponentConns(ConnectionHolder&, int&);
00082 void createSimpleCortexConns(ConnectionHolder&, int&);
00083 void createTopographicConns(ConnectionHolder&, int&);
00084 void createUnstructuredConns(ConnectionHolder&, int&);
00085 void createUnstructuredExInhibConnections(ConnectionHolder& connHolder, int& connectionCount);
00086 bool evaluateConnectionProbability(double, double, double);
00087 void fillRandomSelectionVector(vector<unsigned int> &ranSelVect, unsigned int startNeuronID, unsigned int endNeuronID, double connectionDensity);
00088 unsigned short getDelay(unsigned short, unsigned short);
00089 double getDistance(int, int, int, int);
00090 double getNormalRandom();
00091 short getWeight(double, double, double);
00092 bool isExcitatoryNeuron(unsigned int neuronID, double excitatoryPercentage);
00093
00094 };
00095
00096
00097 #endif//CONNECTIONMANAGER_H