AnimatLab  2
Test
CsSynapseFull.cpp
1 
7 #include "StdAfx.h"
8 
9 #include "CsSynapseGroup.h"
10 #include "CsNeuronGroup.h"
11 #include "CsNeuralModule.h"
12 #include "CsSynapseFull.h"
13 
14 namespace AnimatCarlSim
15 {
16 
24 {
25  m_bNoDirectConnect = false;
26 }
27 
35 {
36 
37 try
38 {
39 }
40 catch(...)
41 {Std_TraceMsg(0, "Caught Error in desctructor of CsSynapseOneToOne\r\n", "", -1, false, true);}
42 }
43 
44 void CsSynapseFull::NoDirectConnect(bool bVal) {m_bNoDirectConnect = bVal;}
45 
46 bool CsSynapseFull::NoDirectConnect() {return m_bNoDirectConnect;}
47 
48 void CsSynapseFull::SetCARLSimulation()
49 {
50  if(m_bEnabled && m_lpCsModule && m_lpCsModule->SNN() && m_lpFromNeuron && m_lpToNeuron && m_lpFromNeuron->GroupID() >= 0 && m_lpToNeuron->GroupID() >= 0)
51  {
52  if(m_bNoDirectConnect)
54  else
56  }
57 }
58 
59 #pragma region DataAccesMethods
60 
61 bool CsSynapseFull::SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError)
62 {
63  std::string strType = Std_CheckString(strDataType);
64 
65  if(CsSynapseGroup::SetData(strDataType, strValue, false))
66  return true;
67 
68  if(strType == "NODIRECTCONNECT")
69  {
70  NoDirectConnect(Std_ToBool(strValue));
71  return true;
72  }
73 
74  //If it was not one of those above then we have a problem.
75  if(bThrowError)
76  THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType, "Data Type", strDataType);
77 
78  return false;
79 }
80 
81 void CsSynapseFull::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
82 {
83  CsSynapseGroup::QueryProperties(aryProperties);
84 
85  aryProperties.Add(new TypeProperty("NoDirectConnect", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
86 }
87 
88 #pragma endregion
89 
90 void CsSynapseFull::Load(CStdXml &oXml)
91 {
92  CsSynapseGroup::Load(oXml);
93 
94  oXml.IntoElem(); //Into Synapse Element
95 
96  NoDirectConnect(oXml.GetChildBool("NoDirectConnect", m_bNoDirectConnect));
97 
98  oXml.OutOfElem(); //OutOf Synapse Element
99 }
100 
101 } //AnimatCarlSim
102 
103 
104 
105 
106 
107 
Contains the classes for a firing rate neural model.
Definition: CsAdapter.cpp:14
bool m_bPlastic
connection type, either SYN_FIXED or SYN_PLASTIC
CsSynapseFull()
Default constructor.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
float m_fltInitWt
initial weight strength (arbitrary units); should be negative for inhibitory connections ...
int connect(int gIDpre, int gIDpost, const string &_type, float initWt, float maxWt, float _C, uint8_t minDelay, uint8_t maxDelay, bool synWtType=SYN_FIXED, const string &wtType=" ")
make from each neuron in grpId1 to 'numPostSynapses' neurons in grpId2
Definition: snn_cpu.cpp:1600
Declares the CsNeuronGroup class.
CsNeuronGroup * m_lpFromNeuron
The pointer to pre-synaptic neuron.
unsigned char m_iMinDelay
the minimum delay allowed (ms)
virtual ~CsSynapseFull()
Destructor.
int m_iSynapsesCreated
The total number of synapses created.
Declares the synapse class.
bool Std_ToBool(int iVal)
Converts a value toa bool.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
CsNeuronGroup * m_lpToNeuron
The pointer to post-synaptic neuron.
float m_fltMaxWt
upper bound on weight strength (arbitrary units); should be negative for inhibitory connections ...
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
Definition: AnimatBase.h:40
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
unsigned char m_iMaxDelay
the maximum delay allowed (ms)
CsNeuralModule * m_lpCsModule
Pointer to parent CsNeuralModule.
float m_fltPconnect
connection probability