SpikeStream Library
0.2
|
00001 #ifndef NETWORKDAO_H 00002 #define NETWORKDAO_H 00003 00004 //SpikeStream includes 00005 #include "AbstractDao.h" 00006 #include "Box.h" 00007 #include "ConnectionGroup.h" 00008 #include "ConnectionGroupInfo.h" 00009 #include "NetworkInfo.h" 00010 #include "NeuronGroup.h" 00011 #include "NeuronGroupInfo.h" 00012 #include "NeuronType.h" 00013 #include "ParameterInfo.h" 00014 #include "SynapseType.h" 00015 #include "WeightlessNeuron.h" 00016 using namespace spikestream; 00017 00018 //Qt includes 00019 #include <QString> 00020 00021 namespace spikestream{ 00022 00027 class NetworkDao : public AbstractDao { 00028 public: 00029 NetworkDao(const DBInfo& dbInfo); 00030 virtual ~NetworkDao(); 00031 00032 void addNetwork(NetworkInfo& netInfo); 00033 void addWeightlessConnection(unsigned int connectionID, unsigned int patternIndex); 00034 unsigned int addWeightlessNeuronTrainingPattern(unsigned int neuronID, const unsigned char* patternArray, bool output, unsigned int patternArraySize); 00035 void getAllFromConnections(unsigned int networkID, QHash<unsigned int, QHash<unsigned int, bool> >& connMap); 00036 void getAllToConnections(unsigned int networkID, QHash<unsigned int, QHash<unsigned int, bool> >& connMap); 00037 unsigned getConnectionCount(unsigned int networkID); 00038 unsigned getConnectionCount(ConnectionGroup* conGrp);//UNTESTED 00039 unsigned getConnectionCount(const QList<ConnectionGroup*>& conGrpList); 00040 unsigned getConnectionCount(const QList<unsigned>& conGrpIDList);//UNTESTED 00041 unsigned getConnectionCount(const ConnectionGroupInfo& conGrpInfo);//UNTESTED 00042 void getConnectionGroupsInfo(unsigned int networkID, QList<ConnectionGroupInfo>& conGrpInfoList); 00043 unsigned int getConnectionGroupSize(unsigned int connGrpID); 00044 QList< QPair<unsigned, Connection> > getConnections(unsigned int fromNeuronID, unsigned int toNeuronID); 00045 QHash<QString, double> getDefaultNeuronParameters(unsigned int neuronTypeID); 00046 QHash<QString, double> getDefaultSynapseParameters(unsigned int synapseTypeID); 00047 QList<unsigned int> getFromConnections(unsigned int fromNeuronID); 00048 QList<unsigned int> getToConnections(unsigned int toNeuronID); 00049 QList<NetworkInfo> getNetworksInfo(); 00050 unsigned getNeuronCount(unsigned int networkID); 00051 unsigned getNeuronCount(const QList<NeuronGroup*>& neurGrpList); 00052 unsigned getNeuronCount(const NeuronGroupInfo& neurGrpInfo);//UNTESTED 00053 unsigned getNeuronCount(unsigned int networkID, const Box& box); 00054 Box getNeuronGroupBoundingBox(unsigned int neurGrpID); 00055 unsigned int getNeuronGroupID(unsigned int neuronID); 00056 void getNeuronGroupsInfo(unsigned int networkID, QList<NeuronGroupInfo>& neurGrpInfoList); 00057 QList<unsigned int> getNeuronIDs(unsigned int networkID); 00058 NeuronType getNeuronType(unsigned int neuronTypeID); 00059 NeuronType getNeuronType(const QString& neuronTypeDescription);//UNTESTED 00060 QList<NeuronType> getNeuronTypes(); 00061 QHash<QString, double> getNeuronParameters(const NeuronGroupInfo& neurGrpInfo); 00062 unsigned getStartNeuronID(unsigned neuronGroupID); 00063 QHash<QString, double> getSynapseParameters(const ConnectionGroupInfo& conGrpInfo); 00064 SynapseType getSynapseType(unsigned int synapseTypeID); 00065 SynapseType getSynapseType(const QString& synapseTypeDescription);//UNTESTED 00066 QList<SynapseType> getSynapseTypes(); 00067 WeightlessNeuron* getWeightlessNeuron(unsigned int neuronID); 00068 bool isWeightlessNetwork(unsigned int networkID); 00069 bool isWeightlessNeuron(unsigned int neuronID); 00070 void setConnectionGroupProperties(unsigned connectionGroupID, const QString& description); 00071 void setNetworkProperties(unsigned networkID, const QString& name, const QString& description); 00072 void setNeuronGroupProperties(unsigned neuronGroupID, const QString& name, const QString& description); 00073 void setNeuronParameters(const NeuronGroupInfo& info, QHash<QString, double>& paramMap); 00074 void setSynapseParameters(const ConnectionGroupInfo& info, QHash<QString, double>& paramMap); 00075 void setWeight(unsigned connectionID, double weight); 00076 00077 private: 00078 //========================= METHODS =========================== 00079 QList<ParameterInfo> getNeuronParameterInfo(const NeuronType& neuronType); 00080 QList<ParameterInfo> getSynapseParameterInfo(const SynapseType& synapseType); 00081 00082 }; 00083 00084 } 00085 00086 #endif//NETWORKDAO_H 00087 00088