11 #include "CsSpikeGeneratorGroup.h"
12 #include "CsNeuralModule.h"
41 void CsNeuronDataColumn::NeuronID(
const std::string &strValue)
44 THROW_PARAM_ERROR(Cs_Err_lInvalidNeuralIndex, Cs_Err_strInvalidNeuralIndex,
"NeuronID is not an integer", strValue);
46 m_strNeuronID = strValue;
50 int iId = atoi(strValue.c_str());
52 if(iId < 0 || iId >= m_lpNeuron->NeuronCount())
53 THROW_PARAM_ERROR(Cs_Err_lInvalidNeuralIndex, Cs_Err_strInvalidNeuralIndex,
"NeuronID is out of range", strValue);
56 m_lpNeuron->DecrementCollectSpikeDataForNeuron(m_iNeuronID);
61 m_lpNeuron->IncrementCollectSpikeDataForNeuron(m_iNeuronID);
65 unsigned int CsNeuronDataColumn::NeuronID() {
return 0;}
71 DataColumn::DataType(strType);
76 if(strData ==
"SPIKE")
81 if(strOldDataType ==
"SPIKE" && strNewDataType !=
"SPIKE" && m_iNeuronID >= 0)
82 m_lpNeuron->DecrementCollectSpikeDataForNeuron(m_iNeuronID);
83 else if(strNewDataType ==
"SPIKE" && strOldDataType !=
"SPIKE" && m_iNeuronID >= 0)
84 m_lpNeuron->IncrementCollectSpikeDataForNeuron(m_iNeuronID);
87 #pragma region DataAccesMethods
93 if(DataColumn::SetData(strDataType, strValue,
false))
96 if(strType ==
"SUBDATA")
104 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
109 void CsNeuronDataColumn::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
111 DataColumn::QueryProperties(aryProperties);
113 aryProperties.Add(
new TypeProperty(
"SubData", AnimatPropertyType::String, AnimatPropertyDirection::Set));
120 DataColumn::Initialize();
128 THROW_PARAM_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType,
"Neuron: ",
m_lpTarget->
ID());
130 if(m_strNeuronID.length() > 0)
131 NeuronID(m_strNeuronID);
135 void CsNeuronDataColumn::Deactivate()
140 FillInDeactivateData();
143 void CsNeuronDataColumn::FillInDeactivateData()
153 std::pair<std::multimap<int, unsigned long>::iterator, std::multimap<int, unsigned long>::iterator> arySpikeTimes = m_lpNeuron->SpikeTimes()->equal_range(m_iNeuronID);
155 for (std::multimap<int, unsigned long>::iterator it = arySpikeTimes.first; it != arySpikeTimes.second; ++it)
157 int iTime = (int) (*it).second;
158 float fltTime = iTime*CARLSIM_STEP_INCREMENT;
160 int iRow = (
int) ((fltTime/fltTimeBase)+0.5);
162 if( (
m_iColumnIndex>=0) && (m_iColumnIndex<lColumnCount) && (iRow>=0) && (iRow<lRowCount))
169 void CsNeuronDataColumn::Load(CStdXml &oXml)
171 DataColumn::Load(oXml);
175 if(oXml.FindChildElement(
"SubData",
false))
176 NeuronID(oXml.GetChildString(
"SubData"));
Contains the classes for a firing rate neural model.
Declares the CsNeuronGroup class.
bool Std_IsNumeric(std::string strVal)
Tests if this string is a number.
virtual std::string ID()
Gets the unique GUID ID of this object.
virtual long RowCount()
Gets the row count.
virtual void SetData(int iColumn, int iRow, float fltVal)
Sets a data element to the data buffer.
virtual float ChartTimeBase()
Gets the Time base used by this data chart.
CsNeuronDataColumn()
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.
virtual std::string DataType()
Gets the data type of the variable we are collecting. This is the value passed into GetDataPointer...
DataChart * m_lpChart
Pointer to the parent DataChart.
Declares the synapse class.
Firing Rate Neuron model.
virtual bool SetStartEndTime()
Gets whether a start/end time is set for this chart.
AnimatBase * m_lpTarget
Pointer to the target object that contains the data variable we will be collecting.
virtual long ColumnCount()
Gets the column count.
virtual void Initialize()
Initializes this object.
std::string m_strDataType
The Data type of the variable we will be collecting. This is passed into the GetDataPointer method of...
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the data column class.
virtual ~CsNeuronDataColumn()
Destructor.