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

ConnectionManager Class Reference

#include <ConnectionManager.h>

List of all members.

Public Member Functions

 ConnectionManager (DBInterface *netDBInter, DBInterface *devDBInter)
int createConnections (ConnectionHolder)
void deleteConnections (vector< ConnectionHolder >)
 ~ConnectionManager ()

Private Member Functions

bool connectionExists (mysqlpp::Query &, unsigned int, unsigned int)
 ConnectionManager (const ConnectionManager &)
void createOffCentreOnSurroundConns (ConnectionHolder &, int &)
void createOnCentreOffSurroundConns (ConnectionHolder &, int &)
void createSIMNOSComponentConns (ConnectionHolder &, int &)
void createSimpleCortexConns (ConnectionHolder &, int &)
void createTopographicConns (ConnectionHolder &, int &)
void createUnstructuredConns (ConnectionHolder &, int &)
void createUnstructuredExInhibConnections (ConnectionHolder &connHolder, int &connectionCount)
bool evaluateConnectionProbability (double, double, double)
void fillRandomSelectionVector (vector< unsigned int > &ranSelVect, unsigned int startNeuronID, unsigned int endNeuronID, double connectionDensity)
unsigned short getDelay (unsigned short, unsigned short)
double getDistance (int, int, int, int)
double getNormalRandom ()
short getWeight (double, double, double)
bool isExcitatoryNeuron (unsigned int neuronID, double excitatoryPercentage)
ConnectionManager operator= (const ConnectionManager &)

Private Attributes

DBInterface * deviceDBInterface
DBInterface * networkDBInterface
QProgressDialog * progressDialog
SpikeStreamApplicationspikeStrApp


Detailed Description

Creates different types of connection in the Connections and Connection Groups databases. Controlled by Connection Widget.

Definition at line 47 of file ConnectionManager.h.


Constructor & Destructor Documentation

ConnectionManager::ConnectionManager DBInterface *  netDBInter,
DBInterface *  devDBInter
 

Constructor.

Definition at line 51 of file ConnectionManager.cpp.

References deviceDBInterface, networkDBInterface, progressDialog, spikeStrApp, and SpikeStreamMainWindow::spikeStreamApplication.

ConnectionManager::~ConnectionManager  ) 
 

Destructor.

Definition at line 68 of file ConnectionManager.cpp.

References progressDialog.

ConnectionManager::ConnectionManager const ConnectionManager  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

bool ConnectionManager::connectionExists mysqlpp::Query &  query,
unsigned int  fromID,
unsigned int  toID
[private]
 

Method that checks to see whether a connection between these neurons already exists in the database At present only a single from, to connection can be made between two neurons. This could be easily changed at a later point by making the primary key of the Connections table more complex so that it includes the connection group or synapse type, for example. In this first version things are being kept simple.

Definition at line 242 of file ConnectionManager.cpp.

Referenced by createOnCentreOffSurroundConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), and createUnstructuredExInhibConnections().

int ConnectionManager::createConnections ConnectionHolder  connHolder  ) 
 

Creates a new connection group of the type specified in the connection holder Only one connection group of each type can exist between two neuron groups. Only one from-to and one to-from connection can exist between two neurons.

Definition at line 84 of file ConnectionManager.cpp.

References ConnectionHolder::connectionGrpID, ConnectionHolder::connectionType, createOffCentreOnSurroundConns(), createOnCentreOffSurroundConns(), createSIMNOSComponentConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), createUnstructuredExInhibConnections(), ConnectionHolder::fromLayerID, ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, ConnectionHolder::synapseType, and ConnectionHolder::toLayerID.

Referenced by ConnectionWidget::createConnections().

void ConnectionManager::createOffCentreOnSurroundConns ConnectionHolder ,
int & 
[private]
 

OFF CENTRE ON SURROUND CONNECTIONS FIXME NOT IMPLEMENTED AT PRESENT.

Definition at line 254 of file ConnectionManager.cpp.

Referenced by createConnections().

void ConnectionManager::createOnCentreOffSurroundConns ConnectionHolder connHolder,
int &  connectionCount
[private]
 

ON CENTRE OFF SURROUND CONNECTIONS Method that creates on centre off surround connections. These are rectangular in shape at present. In the future it would be nice to add a circular option Basic strategy for this function is to work through each of the to neurons, select the neurons in the from layer that are within the connection area, work through this selection and then create the connection.

Definition at line 264 of file ConnectionManager.cpp.

References connectionExists(), ConnectionHolder::connectionGrpID, createConnectionException, ConnectionHolder::fromLayerID, getDelay(), getWeight(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, progressDialog, and ConnectionHolder::toLayerID.

Referenced by createConnections().

void ConnectionManager::createSIMNOSComponentConns ConnectionHolder connHolder,
int &  connectionCount
[private]
 

Creates topographic connections between this layer and part of the device layer Each component contains a list of receptor ids and so have to work through these and make the appropriate connections to the device input layer.

Definition at line 447 of file ConnectionManager.cpp.

References ConnectionHolder::componentID, ConnectionHolder::connectionGrpID, deviceDBInterface, ConnectionHolder::deviceIsFrom, ConnectionHolder::fromLayerID, getDelay(), getWeight(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, and ConnectionHolder::toLayerID.

Referenced by createConnections().

void ConnectionManager::createSimpleCortexConns ConnectionHolder connHolder,
int &  connectionCount
[private]
 

SIMPLE CORTEX CONNECTIONS Method that creates cortex style connections within a single layer. Combines short range excitation with long range inhibition. Normally distributed random selection of neurons within a circle Strategy is to select each neuron within the layer and connect appropriateliy to all neurons within the circle regardless of whether the central neuron is on the edge or not.

Definition at line 564 of file ConnectionManager.cpp.

References connectionExists(), ConnectionHolder::connectionGrpID, evaluateConnectionProbability(), ConnectionHolder::fromLayerID, getDelay(), getDistance(), getWeight(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, and progressDialog.

Referenced by createConnections().

void ConnectionManager::createTopographicConns ConnectionHolder connHolder,
int &  connectionCount
[private]
 

Creates connections that are topographically mapped between the two layers NOTE Only works between layers of identical size.

Definition at line 738 of file ConnectionManager.cpp.

References connectionExists(), ConnectionHolder::connectionGrpID, ConnectionHolder::fromLayerID, getDelay(), getWeight(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, progressDialog, spikeStrApp, and ConnectionHolder::toLayerID.

Referenced by createConnections().

void ConnectionManager::createUnstructuredConns ConnectionHolder connHolder,
int &  connectionCount
[private]
 

Creates an unstructured set of connections selected at random between two layers. Works through each of the neurons in the from layer and selects a random subset of neurons to connect to in the to layer.

Definition at line 959 of file ConnectionManager.cpp.

References connectionExists(), ConnectionHolder::connectionGrpID, fillRandomSelectionVector(), ConnectionHolder::fromLayerID, getDelay(), getWeight(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, progressDialog, spikeStrApp, and ConnectionHolder::toLayerID.

Referenced by createConnections().

void ConnectionManager::createUnstructuredExInhibConnections ConnectionHolder connHolder,
int &  connectionCount
[private]
 

Creates unstructured connections in which each neuron either makes excitatory connections or inhibitory connections. Similar to the basic unstructured method.

Definition at line 1047 of file ConnectionManager.cpp.

References connectionExists(), ConnectionHolder::connectionGrpID, fillRandomSelectionVector(), ConnectionHolder::fromLayerID, getDelay(), getWeight(), isExcitatoryNeuron(), ConnectionHolder::maxDelay, ConnectionHolder::minDelay, networkDBInterface, ConnectionHolder::paramMap, progressDialog, spikeStrApp, and ConnectionHolder::toLayerID.

Referenced by createConnections().

void ConnectionManager::deleteConnections vector< ConnectionHolder connectionVector  ) 
 

Deletes connections from the ConnectionGroups table and the Connections table.

Definition at line 195 of file ConnectionManager.cpp.

References networkDBInterface.

Referenced by ConnectionWidget::deleteConnections().

bool ConnectionManager::evaluateConnectionProbability double  radius,
double  distance,
double  connectionDensity
[private]
 

For cortex connections want to create a normally distributed connection pattern where neurons that are closest to the connecting neuron are most likely to get connected and neurons closest to the radius are least likely to be connected. This method evaluates whether the connection should be created depending on its distance from the neuron. Also has a control (connectionDensity) which varies this probability. Should create a normal distribution of connections surrounding neuron.

Definition at line 1157 of file ConnectionManager.cpp.

References getNormalRandom().

Referenced by createSimpleCortexConns().

void ConnectionManager::fillRandomSelectionVector vector< unsigned int > &  ranSelVect,
unsigned int  startNeuronID,
unsigned int  endNeuronID,
double  connectionDensity
[private]
 

Creates a list of to neurons to connect to. A random number is generated and if this is greater than the connection density * ran max, then the neuronID is added to the vector

Definition at line 1194 of file ConnectionManager.cpp.

Referenced by createUnstructuredConns(), and createUnstructuredExInhibConnections().

unsigned short ConnectionManager::getDelay unsigned short  minDelay,
unsigned short  maxDelay
[private]
 

Generates the delay for a connection. Returns a positive random number between minDelay and maxDelay.

Definition at line 1205 of file ConnectionManager.cpp.

References createConnectionException.

Referenced by createOnCentreOffSurroundConns(), createSIMNOSComponentConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), and createUnstructuredExInhibConnections().

double ConnectionManager::getDistance int  xPos1,
int  yPos1,
int  xPos2,
int  yPos2
[private]
 

Returns the distance between point 1 and point 2 using Pythagoras.

Definition at line 1233 of file ConnectionManager.cpp.

Referenced by createSimpleCortexConns().

double ConnectionManager::getNormalRandom  )  [private]
 

Returns a normally distributed random number with standar deviation = 1 Uses Box-Muller method to generate values Code adapted from http://www.csit.fsu.edu/~burkardt/cpp_src/random_data/random_data.html.

Definition at line 1242 of file ConnectionManager.cpp.

Referenced by evaluateConnectionProbability(), and getWeight().

short ConnectionManager::getWeight double  weight,
double  range,
double  normDist
[private]
 

Applies noise to the given weight, returning a number between -128 and 127 First get the random or normally distributed noise within the noise range Then convert to a number between -128 and 127.

Definition at line 1271 of file ConnectionManager.cpp.

References getNormalRandom().

Referenced by createOnCentreOffSurroundConns(), createSIMNOSComponentConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), and createUnstructuredExInhibConnections().

bool ConnectionManager::isExcitatoryNeuron unsigned int  neuronID,
double  excitatoryPercentage
[private]
 

Returns true if the neuron is an excitatory neuron, either because it already has just excitatory connections or a random number is used to select its type.

Definition at line 1320 of file ConnectionManager.cpp.

References createConnectionException, and networkDBInterface.

Referenced by createUnstructuredExInhibConnections().

ConnectionManager ConnectionManager::operator= const ConnectionManager  )  [private]
 

Declare assignment private so it cannot be used inadvertently.


Member Data Documentation

DBInterface* ConnectionManager::deviceDBInterface [private]
 

Reference to device database handling class.

Definition at line 62 of file ConnectionManager.h.

Referenced by ConnectionManager(), and createSIMNOSComponentConns().

DBInterface* ConnectionManager::networkDBInterface [private]
 

Reference to network database handling class.

Definition at line 59 of file ConnectionManager.h.

Referenced by ConnectionManager(), createConnections(), createOnCentreOffSurroundConns(), createSIMNOSComponentConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), createUnstructuredExInhibConnections(), deleteConnections(), and isExcitatoryNeuron().

QProgressDialog* ConnectionManager::progressDialog [private]
 

Progress dialog to give feedback about progress of connection creation.

Definition at line 65 of file ConnectionManager.h.

Referenced by ConnectionManager(), createOnCentreOffSurroundConns(), createSimpleCortexConns(), createTopographicConns(), createUnstructuredConns(), createUnstructuredExInhibConnections(), and ~ConnectionManager().

SpikeStreamApplication* ConnectionManager::spikeStrApp [private]
 

Short version of the reference to QApplication to update it during large connection creations.

Definition at line 69 of file ConnectionManager.h.

Referenced by ConnectionManager(), createTopographicConns(), createUnstructuredConns(), and createUnstructuredExInhibConnections().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:29:05 2007 for SpikeStream Application by  doxygen 1.4.4