AnimatLab
2
Test
|
Firing Rate Neuron model. More...
#include <Neuron.h>
Public Member Functions | |
Neuron () | |
Default constructor. More... | |
virtual | ~Neuron () |
Destructor. More... | |
virtual float | AccommodationTimeConstant () |
Gets the accomodation time constant. More... | |
virtual void | AccommodationTimeConstant (float fltVal) |
Sets the accomodation time constant. More... | |
virtual void | AddExternalI (float fltVal) |
Adds to the external current. More... | |
virtual void | AddExternalNodeInput (int iTargetDataType, float fltInput) |
Adds an external node input. More... | |
virtual bool | AddItem (const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false) |
Adds a new object to this parent. More... | |
virtual void | AddSynapse (Synapse *lpSynapse) |
Adds a synapse to this neuron. More... | |
virtual void | AddSynapse (std::string strXml, bool bDoNotInit) |
Adds a synapse using an xml packet. More... | |
virtual long | CalculateSnapshotByteSize () |
Calculates the snapshot byte size. More... | |
virtual void | ClearSynapses () |
Clears the synapses list. More... | |
virtual float | Cn () |
Gets the membrane capacitance. More... | |
virtual void | Cn (float fltVal) |
Sets the membrane capacitance. More... | |
virtual void | Copy (CStdSerialize *lpSource) |
virtual float | ExternalI () |
Gets the external current. More... | |
virtual void | ExternalI (float fltVal) |
Sets the external current. More... | |
virtual int | FindSynapseListPos (std::string strID, bool bThrowError=true) |
Searches for a synapse with the specified ID and returns its position in the list. More... | |
virtual float | FiringFreq (FiringRateModule *lpModule) |
Calculates the current firing frequency. More... | |
virtual float | Fmin () |
Gets the minimum firing frequency. More... | |
virtual void | Fmin (float fltVal) |
Sets the minimum firing frequency. More... | |
virtual float | Gain () |
Gets the firing frequency gain. More... | |
virtual void | Gain (float fltVal) |
Sets the firing frequency gain. More... | |
virtual bool | GainType () |
Gets the gain type. (Old way or new way) More... | |
virtual void | GainType (bool bVal) |
Sets the gain type. (Old way or new way) More... | |
virtual float * | GetDataPointer (const std::string &strDataType) |
Returns a float pointer to a data item of interest in this object. More... | |
virtual Synapse * | GetSynapse (int iIndex) |
Gets a synapse by its index in the array. More... | |
virtual CStdPtrArray< Synapse > * | GetSynapses () |
Gets a pointer to the synapses array. More... | |
virtual float | Gn () |
Gets the membrane conductance. More... | |
virtual void | Gn (float fltVal) |
Sets the membrane conductance. More... | |
virtual float | Iinit () |
virtual void | Iinit (float fltVal) |
virtual void | Initialize () |
Initializes this object. More... | |
virtual float | InitTime () |
virtual void | InitTime (float fltVal) |
virtual void | InjectCurrent (float fltVal) |
Injects current into this neuron. More... | |
virtual float | IntrinsicCurrent () |
Gets the intrinsic current. More... | |
virtual void | IntrinsicCurrent (float fltVal) |
Sets the intrinsic current. More... | |
virtual void | Load (CStdXml &oXml) |
virtual void | LoadKeyFrameSnapshot (byte *aryBytes, long &lIndex) |
Loads a key frame snapshot. More... | |
virtual unsigned char | NeuronType () |
Gets the neuron type. More... | |
virtual void | QueryProperties (CStdPtrArray< TypeProperty > &aryProperties) |
virtual float | RelativeAccommodation () |
Gets the relative accomodation. More... | |
virtual void | RelativeAccommodation (float fltVal) |
Sets the relative accomodation. More... | |
virtual bool | RemoveItem (const std::string &strItemType, const std::string &strID, bool bThrowError=true) |
Removes a child item from this parent. More... | |
virtual void | RemoveSynapse (int iIndex) |
Removes the synapse described by iIndex. More... | |
virtual void | RemoveSynapse (std::string strID, bool bThrowError=true) |
Removes the synapse by the GUID ID. More... | |
virtual void | ResetSimulation () |
Resets the simulation back to time 0. More... | |
virtual void | SaveKeyFrameSnapshot (byte *aryBytes, long &lIndex) |
Saves a key frame snapshot. More... | |
virtual bool | SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual void | SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify) |
Sets the system pointers. More... | |
virtual void | StepSimulation () |
Step the simulation for this object. More... | |
virtual void | TimeStepModified () |
Notification method that the time step modified has been modified. Objects should recalculate any slice times as needed. More... | |
virtual int | TotalSynapses () |
Gets the total number of synapses. More... | |
virtual bool | UseAccom () |
Gets whether to use accommodation. More... | |
virtual void | UseAccom (bool bVal) |
Sets whether to use accommodation. More... | |
virtual bool | UseNoise () |
Gets whether to use noise. More... | |
virtual void | UseNoise (bool bVal) |
Sets whether to use noise. More... | |
virtual void | VerifySystemPointers () |
Verify that system pointers have been set correctly. More... | |
virtual float | Vn () |
Gets the membrane voltage. More... | |
virtual float | VNoiseMax () |
Gets the maximum noise voltage. More... | |
virtual void | VNoiseMax (float fltVal) |
Sets the maximum noise voltage. More... | |
virtual float | Vrest () |
Gets the rest potential. More... | |
virtual void | Vrest (float fltVal) |
Sets the rest potential. More... | |
virtual float | Vth () |
Gets the voltage threshold for firing. More... | |
virtual void | Vth (float fltVal) |
Sets the voltage threshold for firing. More... | |
Public Member Functions inherited from AnimatSim::Node | |
Node () | |
Default constructor. More... | |
virtual | ~Node () |
Destructor. More... | |
virtual bool | Enabled () |
Tells whether this node is enabled. More... | |
virtual void | Enabled (bool bValue) |
Enables the node. More... | |
virtual int | GetTargetDataTypeIndex (const std::string &strDataType) |
Used to convert a string target data type into an integer index. More... | |
virtual void | Kill (bool bState=true) |
Kills. More... | |
virtual void | QueryProperties (CStdPtrArray< TypeProperty > &aryProperties) |
Queries this object for a list of properties that can be changed using SetData. More... | |
virtual void | SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify) |
Sets the system pointers. More... | |
Public Member Functions inherited from AnimatSim::AnimatBase | |
AnimatBase () | |
Constructs an AnimatBase object. More... | |
virtual | ~AnimatBase () |
Destroys the AnimatBase object.. More... | |
virtual void | AfterResetSimulation () |
Called after a simulation reset for some objects. More... | |
virtual NeuralModule * | GetNeuralModule () |
Gets the neural module. More... | |
virtual Node * | GetNode () |
Gets the node. More... | |
virtual Simulator * | GetSimulator () |
Gets the simulator pointer. More... | |
virtual Structure * | GetStructure () |
Gets the structure for this node. More... | |
virtual bool | HasProperty (const std::string &strName) |
Queries this object if it has a property with the given name. More... | |
virtual std::string | ID () |
Gets the unique GUID ID of this object. More... | |
virtual void | ID (std::string strValue) |
Sets the unique GUID ID of the object. More... | |
virtual void | Load (StdUtils::CStdXml &oXml) |
Loads the item using an XML data packet. More... | |
virtual std::string | Name () |
Gets the name of this object. More... | |
virtual void | Name (std::string strValue) |
Sets the name of the object. Blank is acceptable. More... | |
virtual AnimatPropertyType | PropertyType (const std::string &strName) |
virtual void | ReInitialize () |
Re-initialize this object. More... | |
virtual void | Reset () |
Resets this object. More... | |
virtual void | RigidBodyAdded (std::string strID) |
virtual void | RigidBodyRemoved (std::string strID) |
virtual bool | Selected () |
Tells if this items is selected or not. More... | |
virtual void | Selected (bool bValue, bool bSelectMultiple) |
Selects this object. More... | |
virtual bool | SetData (const std::string &strDataType, const float fltValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual bool | SetData (const std::string &strDataType, const long lValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual void | SimPausing () |
Called just before the simulation pauses. More... | |
virtual void | SimStarting () |
Called just before the simulation starts. More... | |
virtual void | SimStopping () |
Called just before the simulation stops. More... | |
virtual std::string | Type () |
returns the string type name of this object. More... | |
virtual void | Type (std::string strValue) |
Sets the class type for this object. More... | |
virtual void | VisualSelectionModeChanged (int iNewMode) |
Visual selection mode changed. More... | |
Protected Member Functions | |
virtual float | CalculateFiringFrequency (float fltVn, float fltVth) |
Calculates the firing frequency of the neuron. More... | |
virtual float | CalculateIntrinsicCurrent (FiringRateModule *lpModule, float fltInputCurrent) |
Calculates the intrinsic current. More... | |
virtual float | CalculateSynapticCurrent (FiringRateModule *lpModule) |
Calculates the total incoming synaptic current. More... | |
Synapse * | LoadSynapse (CStdXml &oXml) |
Loads a synapse. More... | |
Protected Member Functions inherited from AnimatSim::Node | |
virtual void | UpdateData () |
Updates any reporting data for this time step. More... | |
Protected Attributes | |
CStdPtrArray< Synapse > | m_arySynapses |
The array of synapses that are in-coming to this neuron. | |
float | m_aryVn [2] |
Current and next Membrane voltage. Vn. | |
float | m_aryVth [2] |
Current and next threshold voltage. Vth. | |
bool | m_bGainType |
Tells whether to use the old type gain or new type gain. | |
bool | m_bUseAccom |
true use accomodation | |
bool | m_bUseNoise |
Tells if we should use noise or not. | |
float | m_fltAccomTimeConst |
The accomodation time constant tells how fast the neuron accomodates to a new membrane potential. | |
float | m_fltAccomTimeMod |
If we are setting the accomodation time constant through modulation then this keeps track of it. | |
float | m_fltAdapterI |
current added from all of the adapters. | |
float | m_fltAdapterMemoryI |
Used to allow datacharts to track current input from adapters. | |
float | m_fltCn |
Membrane capacitance. | |
float | m_fltDCTH |
expon decline working factor for thresh accomm | |
float | m_fltExternalI |
Externally injected current. | |
float | m_fltFiringFreq |
Current firing frequency. | |
float | m_fltFmin |
Minimum Firing frequency. | |
float | m_fltGain |
float | m_fltGn |
Membrane conductance. | |
float | m_fltIinit |
The initialization current to turn on at the beginning of the simulation. | |
float | m_fltInitTime |
The duration for how long the Iinit current is on at the beginning of the simulation. | |
float | m_fltIntrinsicI |
Intrinsic current. | |
float | m_fltInvCn |
Inverse membrane capacitance. | |
float | m_fltRelativeAccom |
The relative accomodation rate. | |
float | m_fltSynapticI |
Current synaptic current. | |
float | m_fltTotalMemoryI |
Total current applied to the neuron. | |
float | m_fltVn |
Current membrane voltage. | |
float | m_fltVndisp |
this is the membrane voltage that is reported back to animatlab. | |
float | m_fltVNoise |
This is the random noise that should be added to the membrane voltage at a timestep. | |
float | m_fltVNoiseMax |
Tells the maximum noise to use when running sim. | |
float | m_fltVrest |
this is the resting potential of the neuron. | |
float | m_fltVth |
Firing frequency voltage threshold. | |
float | m_fltVthadd |
The component added to Vthi for accomodation. | |
float | m_fltVthdisp |
this is the theshold voltage that is reported back to animatlab. | |
float | m_fltVthi |
Initial firing frequency voltage threshold. | |
FiringRateModule * | m_lpFRModule |
Pointer to the parent FiringRateModule. | |
Protected Attributes inherited from AnimatSim::Node | |
bool | m_bInitEnabled |
Keeps track of the enabled state at sim startup. | |
float | m_fltEnabled |
This is used for reporting the enabled state in a GetDataPointer call. | |
Organism * | m_lpOrganism |
The pointer to this node's organism. | |
Protected Attributes inherited from AnimatSim::AnimatBase | |
bool | m_bEnabled |
Tells if this item is enabled or not. If it is not enabled then it is not run. | |
bool | m_bSelected |
Tells whether the object is selected or not. | |
AnimatSim::Behavior::NeuralModule * | m_lpModule |
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL. | |
Node * | m_lpNode |
The pointer to this items parent Node. If this is not relevant for this object then this is NULL. | |
Simulator * | m_lpSim |
The pointer to a Simulation. | |
AnimatSim::Environment::Structure * | m_lpStructure |
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL. | |
std::string | m_strID |
The unique Id for this object. | |
std::string | m_strName |
The name for this object. | |
std::string | m_strType |
The type for this object. Examples are Box, Plane, Neuron, etc.. | |
Additional Inherited Members | |
Static Public Member Functions inherited from AnimatSim::Node | |
static Node * | CastToDerived (AnimatBase *lpBase) |
Firing Rate Neuron model.
This Neuron implements a firing rate neural model. The firing rate model is a more abstract representation of the neuron than an integrate and fire system. This type of model assumes that there is a linear relationship between cell depolarization and firing rate. After the neuron has depolarized beyond its threshold its firing rate increases linearly between 0 and 1 relative to the membrane potential and a gain value. Synapses inject current into post-synaptic neurons based on the firing rate. The synaptic weight is the amount of current to inject, and this is multiplied by the firing rate of the pre-synaptic neuron. this model also has modulatory and gated synapses.
Another feature of this model is that there are a few different types of neruons. These primarily differ based on how they implement intrinsic currents. Intrinsic currents are currents that are internal to the neuron. An exmample of this is the pacemaker neuron that generates currents internally to model bursting behavior.
Definition at line 35 of file FiringRateSim/Neuron.h.
FiringRateSim::Neurons::Neuron::Neuron | ( | ) |
Default constructor.
Definition at line 24 of file FiringRateSim/Neuron.cpp.
References m_aryVn, m_aryVth, AnimatSim::AnimatBase::m_bEnabled, m_bGainType, m_bUseAccom, m_bUseNoise, m_fltAccomTimeConst, m_fltAccomTimeMod, m_fltAdapterI, m_fltAdapterMemoryI, m_fltCn, m_fltDCTH, m_fltExternalI, m_fltFiringFreq, m_fltFmin, m_fltGain, m_fltGn, m_fltIinit, m_fltInitTime, m_fltIntrinsicI, m_fltInvCn, m_fltRelativeAccom, m_fltSynapticI, m_fltTotalMemoryI, m_fltVn, m_fltVndisp, m_fltVNoise, m_fltVNoiseMax, m_fltVrest, m_fltVth, m_fltVthadd, m_fltVthdisp, m_fltVthi, and m_lpFRModule.
|
virtual |
Destructor.
Definition at line 77 of file FiringRateSim/Neuron.cpp.
References m_arySynapses, and StdUtils::Std_TraceMsg().
|
virtual |
Gets the accomodation time constant.
Definition at line 412 of file FiringRateSim/Neuron.cpp.
References m_fltAccomTimeConst.
Referenced by SetData().
|
virtual |
Sets the accomodation time constant.
fltVal | The new value. |
Definition at line 423 of file FiringRateSim/Neuron.cpp.
References m_bUseAccom, m_fltAccomTimeConst, m_fltDCTH, m_lpFRModule, and AnimatSim::Behavior::NeuralModule::TimeStep().
|
virtual |
Adds to the external current.
fltVal | The new value to add. |
Definition at line 255 of file FiringRateSim/Neuron.cpp.
References m_fltExternalI.
Referenced by SetData().
|
virtual |
Adds an external node input.
This is used by the adapter to add a new external value to this node. It is up to the node to interpret what that value means. For example, if it is a neuron then it can interpret it to be a current. This value is added to the current total so that multiple adapters can call this in a given time step. It is cleared out to zero at the beginning of the time step. You can now also specify which data you are adding to for this method call. This allows adapters to be setup to change multiple different variables in the system.
iTargetDataType | The index of the target data type we are adding to. |
fltInput | The new input. |
Implements AnimatSim::Node.
Definition at line 923 of file FiringRateSim/Neuron.cpp.
References m_fltAdapterI, and m_fltAdapterMemoryI.
|
virtual |
Adds a new object to this parent.
Generic method to add a new child item to this parent by specifying a string item type descriptor and an xml packet that can be used to load in the new object. The GUI uses this method to create new items that were added with the user interface. The item type lets the method determine what type of item is being created, like synapse, neuron, body part, etc.. It then gets the modulename, classname, and type from the xml and calls CreateObject to create the appropriate type of object. Then it passes in the xml packet to the new objects load method and does any needed initialization and adds it to the parent.
strItemType | String descriptor of the type of item that is being created. |
strXml | XML packet that is used to create and load the new item. |
bThrowError | If true then throw an error if there is a problem, otherwise return false. |
Reimplemented from AnimatSim::AnimatBase.
Definition at line 1099 of file FiringRateSim/Neuron.cpp.
References AddSynapse(), and StdUtils::Std_CheckString().
|
virtual |
Adds a synapse to this neuron.
[in,out] | lpSynapse | Pointer to the synapse to add. |
Referenced by AddItem(), and LoadSynapse().
|
virtual |
Adds a synapse using an xml packet.
strXml | The xml of the synapse to add. |
Definition at line 597 of file FiringRateSim/Neuron.cpp.
References FiringRateSim::Synapses::Synapse::Initialize(), and LoadSynapse().
|
protectedvirtual |
Calculates the firing frequency of the neuron.
fltVn | The membrane potential. |
fltVth | The threshold potential. |
Definition at line 775 of file FiringRateSim/Neuron.cpp.
References m_bGainType, m_fltFmin, and m_fltGain.
Referenced by FiringFreq(), and StepSimulation().
|
protectedvirtual |
Calculates the intrinsic current.
[in,out] | m_lpFRModule | Pointer to the parent FiringRateModule. |
fltInputCurrent | The input current. |
Reimplemented in FiringRateSim::Neurons::RandomNeuron, FiringRateSim::Neurons::PacemakerNeuron, FiringRateSim::Neurons::BistableNeuron, and FiringRateSim::Neurons::TonicNeuron.
Definition at line 822 of file FiringRateSim/Neuron.cpp.
Referenced by StepSimulation().
|
virtual |
Calculates the snapshot byte size.
Sometimes the user may want to capture a snapshot of the simulation at a given point in time, and then be able to go back to that specific point. To do this we grab a snapshot of all the data in the system, including the neural variables. We essentially serialize the data into a binary format for later re-use. This method calculates the number of bytes that will be required to store the entire object.
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, and FiringRateSim::Neurons::PacemakerNeuron.
Definition at line 1136 of file FiringRateSim/Neuron.cpp.
References m_aryVn, m_fltExternalI, m_fltFiringFreq, m_fltIntrinsicI, m_fltSynapticI, and m_fltVn.
Referenced by FiringRateSim::Neurons::PacemakerNeuron::CalculateSnapshotByteSize(), and FiringRateSim::Neurons::RandomNeuron::CalculateSnapshotByteSize().
|
protectedvirtual |
Calculates the total incoming synaptic current.
[in,out] | m_lpFRModule | Pointer to the parent FiringRateModule. |
Definition at line 835 of file FiringRateSim/Neuron.cpp.
References AnimatSim::Link::Enabled(), FiringRateSim::Synapses::Synapse::FromNeuron(), m_arySynapses, and FiringRateSim::Synapses::Synapse::Process().
Referenced by StepSimulation().
|
virtual |
Clears the synapses list.
Definition at line 699 of file FiringRateSim/Neuron.cpp.
References m_arySynapses.
|
virtual |
Gets the membrane capacitance.
Definition at line 96 of file FiringRateSim/Neuron.cpp.
References m_fltCn.
Referenced by SetData().
|
virtual |
Sets the membrane capacitance.
fltVal | The new value. |
Definition at line 107 of file FiringRateSim/Neuron.cpp.
References m_fltCn, m_fltInvCn, and StdUtils::Std_IsAboveMin().
|
virtual |
Gets the external current.
Definition at line 231 of file FiringRateSim/Neuron.cpp.
References m_fltExternalI.
|
virtual |
Sets the external current.
fltVal | The new value. |
Definition at line 242 of file FiringRateSim/Neuron.cpp.
References m_fltExternalI.
|
virtual |
Searches for a synapse with the specified ID and returns its position in the list.
strID | GUID ID of the synapse to find. |
bThrowError | true to throw error if no synapse is found. |
Definition at line 667 of file FiringRateSim/Neuron.cpp.
References AnimatSim::AnimatBase::ID(), m_arySynapses, StdUtils::Std_ToUpper(), and StdUtils::Std_Trim().
Referenced by RemoveSynapse().
|
virtual |
Calculates the current firing frequency.
[in,out] | m_lpFRModule | Pointer to a fast module. |
Definition at line 490 of file FiringRateSim/Neuron.cpp.
References FiringRateSim::FiringRateModule::ActiveArray(), CalculateFiringFrequency(), m_aryVn, and m_aryVth.
Referenced by FiringRateSim::Synapses::Synapse::CalculateCurrent(), FiringRateSim::Synapses::ModulatedSynapse::CalculateModulation(), FiringRateSim::Synapses::GatedSynapse::CalculateModulation(), and FiringRateSim::Synapses::ModulateNeuronPropSynapse::Process().
|
virtual |
Gets the minimum firing frequency.
Definition at line 180 of file FiringRateSim/Neuron.cpp.
References m_fltFmin.
Referenced by SetData().
|
virtual |
Sets the minimum firing frequency.
fltVal | The new value. |
Definition at line 191 of file FiringRateSim/Neuron.cpp.
References m_fltFmin, and StdUtils::Std_IsAboveMin().
|
virtual |
Gets the firing frequency gain.
Definition at line 206 of file FiringRateSim/Neuron.cpp.
References m_fltGain.
Referenced by SetData().
|
virtual |
Sets the firing frequency gain.
fltVal | The new value. |
Definition at line 217 of file FiringRateSim/Neuron.cpp.
References m_fltGain, and StdUtils::Std_IsAboveMin().
|
virtual |
Gets the gain type. (Old way or new way)
Definition at line 453 of file FiringRateSim/Neuron.cpp.
References m_bGainType.
Referenced by SetData().
|
virtual |
Sets the gain type. (Old way or new way)
bVal | true to use new way, false to use old way. |
Definition at line 464 of file FiringRateSim/Neuron.cpp.
References m_bGainType.
|
virtual |
Returns a float pointer to a data item of interest in this object.
This is a generic method used to get a pointer to data variable of interest. It is used by a variety of systems in the simulation. The most prominent are the data charting and stimulus classes. Within this method we associate a variable with a string name. By passing in the name of the data type we are interested in we can recieve back a float pointer to that data type. We can use that to read or set the data item in other classes. For example, the data charting system gets the pointer and then each time it needs to log a data point it reads the value into an array.
strDataType | name of the data item for which we are looking. |
If | DataType is not found. |
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in FiringRateSim::Neurons::PacemakerNeuron.
Definition at line 931 of file FiringRateSim/Neuron.cpp.
References m_fltAccomTimeMod, m_fltAdapterMemoryI, m_fltExternalI, m_fltFiringFreq, m_fltGn, m_fltIntrinsicI, m_fltSynapticI, m_fltTotalMemoryI, m_fltVndisp, m_fltVNoise, m_fltVrest, m_fltVthdisp, and StdUtils::Std_CheckString().
Referenced by FiringRateSim::Neurons::PacemakerNeuron::GetDataPointer(), FiringRateSim::Synapses::ModulateNeuronPropSynapse::Initialize(), and FiringRateSim::Synapses::ModulateNeuronPropSynapse::PropertyName().
|
virtual |
Gets a synapse by its index in the array.
iIndex | Zero-based index of the synaspe to return. |
Definition at line 649 of file FiringRateSim/Neuron.cpp.
References m_arySynapses.
|
virtual |
Gets a pointer to the synapses array.
Definition at line 578 of file FiringRateSim/Neuron.cpp.
References m_arySynapses.
|
virtual |
Gets the membrane conductance.
Definition at line 123 of file FiringRateSim/Neuron.cpp.
References m_fltGn.
Referenced by SetData().
|
virtual |
Sets the membrane conductance.
fltVal | The new value. |
Definition at line 134 of file FiringRateSim/Neuron.cpp.
References m_fltGn, and StdUtils::Std_IsAboveMin().
|
virtual |
Initializes this object.
After an object is loaded in it must be initialized before it can be used. This allows the object to retrieve any pointers or setup memory that it will need during execution. Each object is responsible for initializing any of its child objects, so you simply need to call this method on the containing class to init all child objects. It also calls VerifySystemPointers to make sure that the system pointers have been setup correctly.
Reimplemented from AnimatSim::AnimatBase.
Definition at line 864 of file FiringRateSim/Neuron.cpp.
References m_arySynapses, m_bUseAccom, m_fltAccomTimeConst, m_fltDCTH, m_lpFRModule, and AnimatSim::Behavior::NeuralModule::TimeStep().
Referenced by FiringRateSim::FiringRateModule::AddNeuron().
|
virtual |
Injects current into this neuron.
fltVal | The new current to add. |
Definition at line 861 of file FiringRateSim/Neuron.cpp.
References m_fltExternalI.
|
virtual |
Gets the intrinsic current.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, and FiringRateSim::Neurons::BistableNeuron.
Definition at line 503 of file FiringRateSim/Neuron.cpp.
References m_fltIntrinsicI.
|
virtual |
Sets the intrinsic current.
fltVal | The new value. |
Reimplemented in FiringRateSim::Neurons::RandomNeuron, and FiringRateSim::Neurons::BistableNeuron.
Definition at line 514 of file FiringRateSim/Neuron.cpp.
References m_fltIntrinsicI.
|
virtual |
Loads a key frame snapshot.
Sometimes the user may want to capture a snapshot of the simulation at a given point in time, and then be able to go back to that specific point. To do this we grab a snapshot of all the data in the system, including the neural variables. We essentially serialize the data into a binary format for later re-use. This method goes through each module and loads its data from the byte array.
[in,out] | aryBytes | The array of bytes where the data is being stored. |
[in,out] | lIndex | Current zero-based index of the read position in the array. |
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, and FiringRateSim::Neurons::PacemakerNeuron.
Definition at line 1163 of file FiringRateSim/Neuron.cpp.
References m_aryVn, m_fltExternalI, m_fltFiringFreq, m_fltIntrinsicI, m_fltSynapticI, and m_fltVn.
Referenced by FiringRateSim::Neurons::PacemakerNeuron::LoadKeyFrameSnapshot(), and FiringRateSim::Neurons::RandomNeuron::LoadKeyFrameSnapshot().
|
protected |
Loads a synapse.
[in,out] | oXml | The xml to load. |
Definition at line 1257 of file FiringRateSim/Neuron.cpp.
References AddSynapse(), AnimatSim::Simulator::CreateObject(), m_lpFRModule, AnimatSim::AnimatBase::m_lpSim, AnimatSim::AnimatBase::m_lpStructure, and FiringRateSim::Synapses::Synapse::SetSystemPointers().
Referenced by AddSynapse().
|
virtual |
Gets the neuron type.
Reimplemented in FiringRateSim::Neurons::PacemakerNeuron, FiringRateSim::Neurons::RandomNeuron, FiringRateSim::Neurons::BistableNeuron, and FiringRateSim::Neurons::TonicNeuron.
Definition at line 525 of file FiringRateSim/Neuron.cpp.
|
virtual |
Gets the relative accomodation.
Definition at line 376 of file FiringRateSim/Neuron.cpp.
References m_fltRelativeAccom.
Referenced by SetData().
|
virtual |
Sets the relative accomodation.
fltVal | The new value. |
Definition at line 387 of file FiringRateSim/Neuron.cpp.
References m_bUseAccom, m_fltAccomTimeConst, m_fltDCTH, m_fltRelativeAccom, m_lpFRModule, StdUtils::Std_InValidRange(), and AnimatSim::Behavior::NeuralModule::TimeStep().
|
virtual |
Removes a child item from this parent.
This is a generic method that is used to delete a child object from this parent. The GUI uses this method to remove objects from the simulation that have been deleted in the UI. The item type lets the method determine what type of item is being deleted, like synapse, neuron, body part, etc.. The ID is then used to delete that specific item.
strItemType | String descriptor of the type of item that is being created. |
strID | Unique ID of the item that will be removed. |
bThrowError | If true then throw an error if there is a problem, otherwise return false. |
Reimplemented from AnimatSim::AnimatBase.
Definition at line 1117 of file FiringRateSim/Neuron.cpp.
References RemoveSynapse(), and StdUtils::Std_CheckString().
|
virtual |
Removes the synapse described by iIndex.
iIndex | Zero-based index of the synapse in the array. |
Definition at line 617 of file FiringRateSim/Neuron.cpp.
References m_arySynapses.
Referenced by RemoveItem().
|
virtual |
Removes the synapse by the GUID ID.
strID | GUID ID for the synapse to remove. |
bThrowError | true to throw error if synaspe not found. |
Definition at line 633 of file FiringRateSim/Neuron.cpp.
References FindSynapseListPos(), and m_arySynapses.
|
virtual |
Resets the simulation back to time 0.
This method calls the ResetSimulation method on all subitems in order to reset the simulation back to the beginning.
Reimplemented from AnimatSim::Node.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, FiringRateSim::Neurons::PacemakerNeuron, and FiringRateSim::Neurons::BistableNeuron.
Definition at line 896 of file FiringRateSim/Neuron.cpp.
References m_arySynapses, m_aryVn, m_aryVth, m_fltAccomTimeMod, m_fltAdapterI, m_fltAdapterMemoryI, m_fltExternalI, m_fltFiringFreq, m_fltIntrinsicI, m_fltSynapticI, m_fltTotalMemoryI, m_fltVn, m_fltVndisp, m_fltVNoise, m_fltVrest, m_fltVth, m_fltVthadd, m_fltVthdisp, m_fltVthi, and AnimatSim::Node::ResetSimulation().
Referenced by FiringRateSim::Neurons::BistableNeuron::ResetSimulation(), FiringRateSim::Neurons::PacemakerNeuron::ResetSimulation(), and FiringRateSim::Neurons::RandomNeuron::ResetSimulation().
|
virtual |
Saves a key frame snapshot.
Sometimes the user may want to capture a snapshot of the simulation at a given point in time, and then be able to go back to that specific point. To do this we grab a snapshot of all the data in the system, including the neural variables. We essentially serialize the data into a binary format for later re-use. This method goes through each module and saves its data into the byte array.
[in,out] | aryBytes | The array of bytes where the data is being stored. |
[in,out] | lIndex | Current zero-based index of the write position in the array. |
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, and FiringRateSim::Neurons::PacemakerNeuron.
Definition at line 1142 of file FiringRateSim/Neuron.cpp.
References m_aryVn, m_fltExternalI, m_fltFiringFreq, m_fltIntrinsicI, m_fltSynapticI, and m_fltVn.
Referenced by FiringRateSim::Neurons::PacemakerNeuron::SaveKeyFrameSnapshot(), and FiringRateSim::Neurons::RandomNeuron::SaveKeyFrameSnapshot().
|
virtual |
Set a variable based on a string data type name.
This is a generic method that can be used to set any variable in an AnimatBase object by specifying the name of the variable and a string representation of that data. The GUI uses this method to set data into variables in the simulation when the user changes them in the UI. The value string can be as simple as a float or int, or as complex as an xml packet. It is the developers responsibilty to know what type of data is needed and to process it accordingly.
strDataType | string name of the data type to set. |
strValue | The string value of the data. It is up to the developer to determine what this should be. For example, in most cases it is simply a float and you just have to convert it to a float and make the appropriate mutator method call. However, it can be any type of string, including an entire xml packet. It is the developers responsibility to know how to set and process the data as required. |
bThrowError | true to throw error if there is a problem. If false then it will not return an error, just return false. |
Reimplemented from AnimatSim::Node.
Reimplemented in FiringRateSim::Neurons::RandomNeuron, FiringRateSim::Neurons::PacemakerNeuron, FiringRateSim::Neurons::BistableNeuron, and FiringRateSim::Neurons::TonicNeuron.
Definition at line 977 of file FiringRateSim/Neuron.cpp.
References AccommodationTimeConstant(), AddExternalI(), Cn(), Fmin(), Gain(), GainType(), Gn(), RelativeAccommodation(), StdUtils::Std_CheckString(), StdUtils::Std_ToBool(), VNoiseMax(), Vrest(), and Vth().
Referenced by FiringRateSim::Neurons::TonicNeuron::SetData(), FiringRateSim::Neurons::BistableNeuron::SetData(), FiringRateSim::Neurons::PacemakerNeuron::SetData(), and FiringRateSim::Neurons::RandomNeuron::SetData().
|
virtual |
Sets the system pointers.
There are a number of system pointers that are needed for use in the objects. The primariy one being a pointer to the simulation object itself so that you can get global parameters like the scale units and so on. However, each object may need other types of pointers as well, for example neurons need to have a pointer to their parent structure/organism, and to the NeuralModule they reside within. So different types of objects will need different sets of system pointers. We call this method to set the pointers just after creation and before Load is called. We then call VerifySystemPointers here, during Load and during Initialize in order to ensure that the correct pointers have been set for each type of objects. These pointers can then be safely used throughout the rest of the system.
[in,out] | lpSim | The pointer to a simulation. |
[in,out] | lpStructure | The pointer to the parent structure. |
[in,out] | lpModule | The pointer to the parent module module. |
[in,out] | lpNode | The pointer to the parent node. |
bVerify | true to call VerifySystemPointers. |
Definition at line 876 of file FiringRateSim/Neuron.cpp.
References m_lpFRModule, and VerifySystemPointers().
Referenced by FiringRateSim::FiringRateModule::LoadNeuron().
|
virtual |
Step the simulation for this object.
This is called on an object each time it is stepped in the simulation. this is where its simulation code is processed. However, StepSimulation is not necessarily called every single time that the simulation as a whole is stepped. A good example of this is that neural modules can have different integration time steps. So a firing rate module may have a DT of 0.5 ms, while an integrate and fire model may have one of 0.1 ms. So the firing rate module would only get its StepSimulation method called every 5th time that the other module was called. This is all handed in the StepSimulation method of the Simulator and NervousSystem.
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in FiringRateSim::Neurons::PacemakerNeuron, and FiringRateSim::Neurons::BistableNeuron.
Definition at line 710 of file FiringRateSim/Neuron.cpp.
References FiringRateSim::FiringRateModule::ActiveArray(), CalculateFiringFrequency(), CalculateIntrinsicCurrent(), CalculateSynapticCurrent(), FiringRateSim::FiringRateModule::InactiveArray(), m_aryVn, m_aryVth, AnimatSim::AnimatBase::m_bEnabled, m_bUseAccom, m_bUseNoise, m_fltAccomTimeMod, m_fltAdapterI, m_fltDCTH, m_fltExternalI, m_fltFiringFreq, m_fltGn, m_fltIinit, m_fltInitTime, m_fltIntrinsicI, m_fltInvCn, m_fltRelativeAccom, m_fltSynapticI, m_fltTotalMemoryI, m_fltVn, m_fltVndisp, m_fltVNoise, m_fltVNoiseMax, m_fltVrest, m_fltVth, m_fltVthadd, m_fltVthdisp, m_fltVthi, m_lpFRModule, AnimatSim::AnimatBase::m_lpSim, StdUtils::Std_FRand(), AnimatSim::Simulator::Time(), and AnimatSim::Behavior::NeuralModule::TimeStep().
Referenced by FiringRateSim::Neurons::BistableNeuron::StepSimulation(), and FiringRateSim::Neurons::PacemakerNeuron::StepSimulation().
|
virtual |
Notification method that the time step modified has been modified. Objects should recalculate any slice times as needed.
Reimplemented from AnimatSim::AnimatBase.
Definition at line 702 of file FiringRateSim/Neuron.cpp.
References m_bUseAccom, m_fltAccomTimeConst, m_fltDCTH, m_lpFRModule, and AnimatSim::Behavior::NeuralModule::TimeStep().
|
virtual |
Gets the total number of synapses.
Definition at line 690 of file FiringRateSim/Neuron.cpp.
References m_arySynapses.
|
virtual |
Gets whether to use accommodation.
Definition at line 330 of file FiringRateSim/Neuron.cpp.
References m_bUseAccom.
|
virtual |
Sets whether to use accommodation.
bVal | true to use accommodation, false else. |
Definition at line 340 of file FiringRateSim/Neuron.cpp.
References m_bUseAccom, m_fltAccomTimeConst, m_fltDCTH, m_lpFRModule, and AnimatSim::Behavior::NeuralModule::TimeStep().
|
virtual |
Gets whether to use noise.
Definition at line 307 of file FiringRateSim/Neuron.cpp.
References m_bUseNoise.
|
virtual |
Sets whether to use noise.
bVal | true to use noise. |
Definition at line 317 of file FiringRateSim/Neuron.cpp.
References m_bUseNoise.
|
virtual |
Verify that system pointers have been set correctly.
The system pointers should be set just after an object is created. However, if for some reason it was not then this could cause read/write memory access errors later on because we would be using NULL pointers. This method is called during SetSystemPointers, Load, and Initialize to verify that the pointers for that type of object have been set correctly. We are calling three different places to ensure that it is checked before use. For example, if you are doing a Load call then you want to check it before attempting the load, but there may be an object that does not Load, but only does Initialize. So we need to check it there as well.
Reimplemented from AnimatSim::Node.
Definition at line 885 of file FiringRateSim/Neuron.cpp.
References AnimatSim::AnimatBase::ID(), m_lpFRModule, AnimatSim::Node::m_lpOrganism, and AnimatSim::AnimatBase::m_strID.
Referenced by SetSystemPointers().
|
virtual |
Gets the membrane voltage.
Definition at line 477 of file FiringRateSim/Neuron.cpp.
References m_fltVn.
|
virtual |
Gets the maximum noise voltage.
Definition at line 296 of file FiringRateSim/Neuron.cpp.
References m_fltVNoiseMax.
Referenced by SetData().
|
virtual |
Sets the maximum noise voltage.
fltVal | The new value. |
Definition at line 358 of file FiringRateSim/Neuron.cpp.
References m_bUseNoise, and m_fltVNoiseMax.
|
virtual |
Gets the rest potential.
Definition at line 268 of file FiringRateSim/Neuron.cpp.
References m_fltVrest.
Referenced by SetData().
|
virtual |
Sets the rest potential.
fltVal | The new value. |
Definition at line 279 of file FiringRateSim/Neuron.cpp.
References m_fltVndisp, m_fltVrest, m_fltVthi, AnimatSim::AnimatBase::m_lpSim, AnimatSim::Simulator::SimRunning(), and Vth().
|
virtual |
Gets the voltage threshold for firing.
Definition at line 149 of file FiringRateSim/Neuron.cpp.
References m_fltVth.
Referenced by SetData(), and Vrest().
|
virtual |
Sets the voltage threshold for firing.
fltVal | The new value. |
Definition at line 160 of file FiringRateSim/Neuron.cpp.
References m_aryVth, m_fltVrest, m_fltVth, m_fltVthadd, m_fltVthdisp, and m_fltVthi.
|
protected |
Firing frequency gain. This is multiplied by the membrane voltage that is above the threshold to determine the firing rate.
Definition at line 55 of file FiringRateSim/Neuron.h.
Referenced by CalculateFiringFrequency(), Gain(), and Neuron().