SpikeStream Library
0.2
|
#include <NetworkDao.h>
Public Member Functions | |
NetworkDao (const DBInfo &dbInfo) | |
virtual | ~NetworkDao () |
void | addNetwork (NetworkInfo &netInfo) |
void | addWeightlessConnection (unsigned int connectionID, unsigned int patternIndex) |
unsigned int | addWeightlessNeuronTrainingPattern (unsigned int neuronID, const unsigned char *patternArray, bool output, unsigned int patternArraySize) |
void | getAllFromConnections (unsigned int networkID, QHash< unsigned int, QHash< unsigned int, bool > > &connMap) |
void | getAllToConnections (unsigned int networkID, QHash< unsigned int, QHash< unsigned int, bool > > &connMap) |
unsigned | getConnectionCount (unsigned int networkID) |
unsigned | getConnectionCount (ConnectionGroup *conGrp) |
unsigned | getConnectionCount (const QList< ConnectionGroup * > &conGrpList) |
unsigned | getConnectionCount (const QList< unsigned > &conGrpIDList) |
unsigned | getConnectionCount (const ConnectionGroupInfo &conGrpInfo) |
void | getConnectionGroupsInfo (unsigned int networkID, QList< ConnectionGroupInfo > &conGrpInfoList) |
unsigned int | getConnectionGroupSize (unsigned int connGrpID) |
QList< QPair< unsigned, Connection > > | getConnections (unsigned int fromNeuronID, unsigned int toNeuronID) |
QHash< QString, double > | getDefaultNeuronParameters (unsigned int neuronTypeID) |
QHash< QString, double > | getDefaultSynapseParameters (unsigned int synapseTypeID) |
QList< unsigned int > | getFromConnections (unsigned int fromNeuronID) |
QList< unsigned int > | getToConnections (unsigned int toNeuronID) |
QList< NetworkInfo > | getNetworksInfo () |
unsigned | getNeuronCount (unsigned int networkID) |
unsigned | getNeuronCount (const QList< NeuronGroup * > &neurGrpList) |
unsigned | getNeuronCount (const NeuronGroupInfo &neurGrpInfo) |
unsigned | getNeuronCount (unsigned int networkID, const Box &box) |
Box | getNeuronGroupBoundingBox (unsigned int neurGrpID) |
unsigned int | getNeuronGroupID (unsigned int neuronID) |
void | getNeuronGroupsInfo (unsigned int networkID, QList< NeuronGroupInfo > &neurGrpInfoList) |
QList< unsigned int > | getNeuronIDs (unsigned int networkID) |
NeuronType | getNeuronType (unsigned int neuronTypeID) |
NeuronType | getNeuronType (const QString &neuronTypeDescription) |
QList< NeuronType > | getNeuronTypes () |
QHash< QString, double > | getNeuronParameters (const NeuronGroupInfo &neurGrpInfo) |
unsigned | getStartNeuronID (unsigned neuronGroupID) |
QHash< QString, double > | getSynapseParameters (const ConnectionGroupInfo &conGrpInfo) |
SynapseType | getSynapseType (unsigned int synapseTypeID) |
SynapseType | getSynapseType (const QString &synapseTypeDescription) |
QList< SynapseType > | getSynapseTypes () |
WeightlessNeuron * | getWeightlessNeuron (unsigned int neuronID) |
bool | isWeightlessNetwork (unsigned int networkID) |
bool | isWeightlessNeuron (unsigned int neuronID) |
void | setConnectionGroupProperties (unsigned connectionGroupID, const QString &description) |
void | setNetworkProperties (unsigned networkID, const QString &name, const QString &description) |
void | setNeuronGroupProperties (unsigned neuronGroupID, const QString &name, const QString &description) |
void | setNeuronParameters (const NeuronGroupInfo &info, QHash< QString, double > ¶mMap) |
void | setSynapseParameters (const ConnectionGroupInfo &info, QHash< QString, double > ¶mMap) |
void | setWeight (unsigned connectionID, double weight) |
Abstraction layer on top of the SpikeStreamNetwork database. Used for light operations taking place in the same thread as the calling function. Operations that are more database intensive can be found in the NetworkDaoThread class.
Definition at line 27 of file NetworkDao.h.
NetworkDao::NetworkDao | ( | const DBInfo & | dbInfo | ) |
Constructor. DBInfo is stored by AbstractDao
Definition at line 15 of file NetworkDao.cpp.
NetworkDao::~NetworkDao | ( | ) | [virtual] |
Destructor
Definition at line 20 of file NetworkDao.cpp.
void NetworkDao::addNetwork | ( | NetworkInfo & | netInfo | ) |
Adds the specified neural network to the database
Definition at line 30 of file NetworkDao.cpp.
void NetworkDao::addWeightlessConnection | ( | unsigned int | connectionID, |
unsigned int | patternIndex | ||
) |
Adds a weightless connection pattern index to the database
Definition at line 44 of file NetworkDao.cpp.
unsigned int NetworkDao::addWeightlessNeuronTrainingPattern | ( | unsigned int | neuronID, |
const unsigned char * | patternArray, | ||
bool | output, | ||
unsigned int | patternArraySize | ||
) |
Adds a weightless neuron training pattern to the database and returns the new pattern id.
Definition at line 51 of file NetworkDao.cpp.
void NetworkDao::getAllFromConnections | ( | unsigned int | networkID, |
QHash< unsigned int, QHash< unsigned int, bool > > & | connMap | ||
) |
Fills the supplied nested hash map with all the connections made FROM a neuron to other neurons. The key is the FROM neuron id, the value is a second map whose key is the TO neuron id and whose value is a boolean always set to true.
Definition at line 186 of file NetworkDao.cpp.
void NetworkDao::getAllToConnections | ( | unsigned int | networkID, |
QHash< unsigned int, QHash< unsigned int, bool > > & | connMap | ||
) |
Fills the supplied nested hash map with all the connections made TO each neuron from other neurons. The key is the TO neuron id, the value is a second map whose key is the FROM neuron id and whose value is a boolean always set to true.
Definition at line 208 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionCount | ( | unsigned int | networkID | ) |
Returns the number of connections in a network
Definition at line 71 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionCount | ( | ConnectionGroup * | conGrp | ) |
Returns the total number of connections in a single connection group
Definition at line 80 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionCount | ( | const QList< ConnectionGroup * > & | conGrpList | ) |
Returns the total number of connections in the list of connection groups
Definition at line 93 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionCount | ( | const QList< unsigned > & | conGrpIDList | ) |
Returns the total number of connections in the list of connection groups
Definition at line 112 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionCount | ( | const ConnectionGroupInfo & | conGrpInfo | ) |
Returns the total number of connections in the connection groups
Definition at line 131 of file NetworkDao.cpp.
void NetworkDao::getConnectionGroupsInfo | ( | unsigned int | networkID, |
QList< ConnectionGroupInfo > & | conGrpInfoList | ||
) |
Fills supplied list with information about the connection groups associated with the specified network
Definition at line 162 of file NetworkDao.cpp.
unsigned int NetworkDao::getConnectionGroupSize | ( | unsigned int | connGrpID | ) |
Returns the number of connections in the specified connection group
Definition at line 398 of file NetworkDao.cpp.
QList< QPair< unsigned, Connection > > NetworkDao::getConnections | ( | unsigned int | fromNeuronID, |
unsigned int | toNeuronID | ||
) |
Returns all of the connections from the specified neuron to the specified neuron.
Definition at line 142 of file NetworkDao.cpp.
QHash< QString, double > NetworkDao::getDefaultNeuronParameters | ( | unsigned int | neuronTypeID | ) |
Returns a map containing the default neuron parameters for a neuron type
Definition at line 262 of file NetworkDao.cpp.
QHash< QString, double > NetworkDao::getDefaultSynapseParameters | ( | unsigned int | synapseTypeID | ) |
Returns a map containing the default parameters for the specified synapse type
Definition at line 294 of file NetworkDao.cpp.
QList< unsigned int > NetworkDao::getFromConnections | ( | unsigned int | fromNeuronID | ) |
Returns a list of all the connections FROM the specified neuron
Definition at line 228 of file NetworkDao.cpp.
QList< NetworkInfo > NetworkDao::getNetworksInfo | ( | ) |
Returns a list of information about the available networks.
Definition at line 407 of file NetworkDao.cpp.
unsigned int NetworkDao::getNeuronCount | ( | unsigned int | networkID | ) |
Returns the number of neurons in a network
Definition at line 345 of file NetworkDao.cpp.
unsigned int NetworkDao::getNeuronCount | ( | const QList< NeuronGroup * > & | neurGrpList | ) |
Returns the total number of neurons in the list of neuron groups
Definition at line 326 of file NetworkDao.cpp.
unsigned NetworkDao::getNeuronCount | ( | const NeuronGroupInfo & | neurGrpInfo | ) |
Returns the number of neurons in a neuron group
Definition at line 354 of file NetworkDao.cpp.
unsigned int NetworkDao::getNeuronCount | ( | unsigned int | networkID, |
const Box & | box | ||
) |
Returns the number of neurons within the specified box. Useful for determining overlap when adding neuron groups to networks
Definition at line 364 of file NetworkDao.cpp.
Box NetworkDao::getNeuronGroupBoundingBox | ( | unsigned int | neurGrpID | ) |
Returns a box enclosing a particular neuron group
Definition at line 381 of file NetworkDao.cpp.
unsigned int NetworkDao::getNeuronGroupID | ( | unsigned int | neuronID | ) |
Returns the neuron group containing the specified neuron
Definition at line 685 of file NetworkDao.cpp.
void NetworkDao::getNeuronGroupsInfo | ( | unsigned int | networkID, |
QList< NeuronGroupInfo > & | neurGrpInfoList | ||
) |
Returns information about the neuron groups associated with the specified network
Definition at line 420 of file NetworkDao.cpp.
QList< unsigned int > NetworkDao::getNeuronIDs | ( | unsigned int | networkID | ) |
Returns a list of the neuron ids in the specified network
Definition at line 441 of file NetworkDao.cpp.
QHash< QString, double > NetworkDao::getNeuronParameters | ( | const NeuronGroupInfo & | neurGrpInfo | ) |
Returns a map containing the parameters for the specified neuron group
Definition at line 454 of file NetworkDao.cpp.
NeuronType NetworkDao::getNeuronType | ( | unsigned int | neuronTypeID | ) |
Returns the neuron type for a specific neuron group
Definition at line 496 of file NetworkDao.cpp.
NeuronType NetworkDao::getNeuronType | ( | const QString & | neuronTypeDescription | ) |
Returns the neuron type for a specific neuron type description
Definition at line 508 of file NetworkDao.cpp.
QList< NeuronType > NetworkDao::getNeuronTypes | ( | ) |
Returns the current list of available neuron types. This information is stored in the NeuronTypes table.
Definition at line 521 of file NetworkDao.cpp.
unsigned NetworkDao::getStartNeuronID | ( | unsigned | neuronGroupID | ) |
Returns the first neuron ID in the group
Definition at line 546 of file NetworkDao.cpp.
QHash< QString, double > NetworkDao::getSynapseParameters | ( | const ConnectionGroupInfo & | conGrpInfo | ) |
Returns a map containing the parameters for the specified connection group
Definition at line 579 of file NetworkDao.cpp.
SynapseType NetworkDao::getSynapseType | ( | unsigned int | synapseTypeID | ) |
Returns the synapse type for a specific connection group
Definition at line 555 of file NetworkDao.cpp.
SynapseType NetworkDao::getSynapseType | ( | const QString & | synapseTypeDescription | ) |
Returns the synapse type for a specific description.
Definition at line 567 of file NetworkDao.cpp.
QList< SynapseType > NetworkDao::getSynapseTypes | ( | ) |
Returns the current list of available synapse types. This information is stored in the SynapseTypes table.
Definition at line 622 of file NetworkDao.cpp.
QList< unsigned int > NetworkDao::getToConnections | ( | unsigned int | toNeuronID | ) |
Returns a list of all the connections TO the specified neuron
Definition at line 245 of file NetworkDao.cpp.
WeightlessNeuron * NetworkDao::getWeightlessNeuron | ( | unsigned int | neuronID | ) |
Returns the weightless neuron with the specified ID.
Definition at line 648 of file NetworkDao.cpp.
bool NetworkDao::isWeightlessNetwork | ( | unsigned int | networkID | ) |
Returns true if all the neurons in the network are weightless. Uses the string "Weightless Neuron" rather than the ID, which may change.
Definition at line 712 of file NetworkDao.cpp.
bool NetworkDao::isWeightlessNeuron | ( | unsigned int | neuronID | ) |
Returns true if the neuron is weightless. Uses the string "Weightless Neuron" rather than the ID, which may change.
Definition at line 695 of file NetworkDao.cpp.
void NetworkDao::setConnectionGroupProperties | ( | unsigned | connectionGroupID, |
const QString & | description | ||
) |
Sets the description of a connection group
Definition at line 728 of file NetworkDao.cpp.
void NetworkDao::setNetworkProperties | ( | unsigned | networkID, |
const QString & | name, | ||
const QString & | description | ||
) |
Sets the name and description of the specified network. Throws an exception if no rows were changed.
Definition at line 740 of file NetworkDao.cpp.
void NetworkDao::setNeuronGroupProperties | ( | unsigned | neuronGroupID, |
const QString & | name, | ||
const QString & | description | ||
) |
Sets the name and description of a neuron group
Definition at line 751 of file NetworkDao.cpp.
void NetworkDao::setNeuronParameters | ( | const NeuronGroupInfo & | neurGrpInfo, |
QHash< QString, double > & | paramMap | ||
) |
Sets the neuron group's parameters
Definition at line 762 of file NetworkDao.cpp.
void NetworkDao::setSynapseParameters | ( | const ConnectionGroupInfo & | conGrpInfo, |
QHash< QString, double > & | paramMap | ||
) |
Sets the connection group's parameters
Definition at line 786 of file NetworkDao.cpp.
void NetworkDao::setWeight | ( | unsigned | connectionID, |
double | newWeight | ||
) |
Sets the weight between two neurons.
Definition at line 810 of file NetworkDao.cpp.