Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

ConnectionManager.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   SpikeStream Application                                               *
00003  *   Copyright (C) 2007 by David Gamez                                     *
00004  *   david@davidgamez.eu                                                   *
00005  *   Version 0.1                                                           *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 
00023 #ifndef CONNECTIONMANAGER_H
00024 #define CONNECTIONMANAGER_H
00025 
00026 //SpikeStream includes
00027 #include "DBInterface.h"
00028 #include "GlobalVariables.h"
00029 #include "ConnectionHolder.h"
00030 #include "SpikeStreamApplication.h"
00031 
00032 //Qt includes
00033 #include <qstring.h>
00034 #include <qprogressdialog.h>
00035 
00036 //Other includes
00037 #include <map>
00038 #include <string>
00039 using namespace std;
00040 
00041 
00042 //----------------------- Connection Manager ------------------------------
00043 /*! Creates different types of connection in the Connections and Connection
00044         Groups databases. Controlled by Connection Widget.*/
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                 //=========================== VARIABLES =====================================
00058                 /*! Reference to network database handling class.*/
00059                 DBInterface *networkDBInterface;
00060 
00061                 /*! Reference to device database handling class.*/
00062                 DBInterface *deviceDBInterface;
00063                 
00064                 /*! Progress dialog to give feedback about progress of connection creation.*/
00065                 QProgressDialog *progressDialog;
00066 
00067                 /*! Short version of the reference to QApplication to update it during
00068                         large connection creations.*/
00069                 SpikeStreamApplication *spikeStrApp;
00070 
00071 
00072                 //============================ METHODS ======================================
00073                 /*! Declare copy constructor private so it cannot be used inadvertently.*/
00074                 ConnectionManager(const ConnectionManager&);
00075                 /*! Declare assignment private so it cannot be used inadvertently.*/
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

Generated on Mon Sep 3 22:29:04 2007 for SpikeStream Application by  doxygen 1.4.4