8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
14 #include "IPhysicsMovableItem.h"
15 #include "IPhysicsBody.h"
17 #include "MovableItem.h"
46 namespace ExternalStimuli
97 {
Std_TraceMsg(0,
"Caught Error in desctructor of CurrentStimulus\r\n",
"", -1,
false,
true);}
126 m_iType = AL_REPETITIVE_CURRENT;
130 THROW_PARAM_ERROR(Al_Err_lInvalidCurrentType, Al_Err_strInvalidCurrentType,
"Type", strType);
141 if(
m_iType == AL_TONIC_CURRENT)
146 else if(
m_iType == AL_REPETITIVE_CURRENT)
231 Std_IsAboveMin((
float) 0, fltVal,
true,
"CycleOnDuration",
false);
256 Std_IsAboveMin((
float) 0, fltVal,
true,
"CycleOffDuration",
true);
281 Std_IsAboveMin((
float) 0, fltVal,
true,
"BurstOnDuration",
false);
306 Std_IsAboveMin((
float) 0, fltVal,
true,
"BurstOffDuration",
true);
332 THROW_PARAM_ERROR(Al_Err_lInvalidCurrentType, Al_Err_strInvalidCurrentType,
"ID", strID);
395 THROW_PARAM_ERROR(Al_Err_lNodeNotFound, Al_Err_strNodeNotFound,
"ID: ",
m_strTargetNodeID);
400 THROW_TEXT_ERROR(Al_Err_lDataPointNotFound, Al_Err_strDataPointNotFound,
424 void CurrentStimulus::SetSliceData()
426 ActivatedItem::SetSliceData();
526 if(strType ==
"ACTIVECURRENT")
529 THROW_TEXT_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"StimulusName: " + STR(
m_strName) +
" DataType: " + strDataType);
541 if(strType ==
"CURRENTON")
543 CurrentOn((
float) atof(strValue.c_str()));
547 if(strType ==
"CURRENTOFF")
553 if(strType ==
"CURRENTBURSTOFF")
559 if(strType ==
"CYCLEONDURATION")
565 if(strType ==
"CYCLEOFFDURATION")
571 if(strType ==
"BURSTONDURATION")
577 if(strType ==
"BURSTOFFDURATION")
583 if(strType ==
"EQUATION")
591 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
600 aryProperties.Add(
new TypeProperty(
"ActiveCurrent", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
602 aryProperties.Add(
new TypeProperty(
"CurrentOn", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
603 aryProperties.Add(
new TypeProperty(
"CurrentOff", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
604 aryProperties.Add(
new TypeProperty(
"CurrentBurstOff", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
605 aryProperties.Add(
new TypeProperty(
"CycleOnDuration", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
606 aryProperties.Add(
new TypeProperty(
"CycleOffDuration", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
607 aryProperties.Add(
new TypeProperty(
"BurstOnDuration", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
608 aryProperties.Add(
new TypeProperty(
"BurstOffDuration", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
609 aryProperties.Add(
new TypeProperty(
"CurrentEquation", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
612 void CurrentStimulus::Load(
CStdXml &oXml)
614 ActivatedItem::Load(oXml);
virtual float GetCurrentOn()
Calculates the on cycle current at this time step.
Declares the external stimulus base class.
float m_fltCurrentBurstOff
The current to apply when the burst is off.
Base class file for all Animat simulation objects.
Declares the nervous system class.
virtual std::string CurrentEquation()
Gets the post-fix current equation string. If this is null then an equation is not used...
void AddVariable(std::string strVarName)
Adds a variable.
virtual void Activate()
Activates this item.
Declares the simulation recorder class.
long m_lCycleOffDuration
Duration of the cycle off period in time slices.
virtual void Deactivate()
Deactivates this item.
Root namespace for the base simulation library for AnimatLab.
virtual float CurrentBurstOff()
Gets the off burst current value.
Declares the body part class.
float m_fltBurstOnDuration
Duration of the burst on period in time.
std::string m_strTargetNodeID
GUID ID of the neuron we are stimulating.
long m_lCycleOnDuration
Duration of the cycle on period in time slices.
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 void Activate()
Activates this item.
bool m_bBurstOn
Tells whether a burst is on or not.
Simulator * m_lpSim
The pointer to a Simulation.
virtual float CurrentOff()
Gets the ffn cycle current value.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
Class that stores information about types for QueryProperty information.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
Declares the link base class.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the key frame class.
virtual float BurstOnDuration()
Gets the on burst current duration in time.
float m_fltCycleOnDuration
Duration of the cycle on period in time.
Declares the joint class.
Declares the organism class.
virtual float CurrentOn()
Gets the on cycle current value.
virtual std::string Type()
Gets the integer value of current type. This is (Constant, repetitive, and bursting) ...
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
std::string m_strID
The unique Id for this object.
std::string m_strCurrentEquation
The post-fix string current equation.
std::string Std_Trim(std::string strVal)
Trims a string.
bool m_bCycleOn
Tells whether a cycle is on or not.
Declares the activated item class.
virtual float TimeStep()
Gets the smallest integration time step used within the simulation.
Declares a light manager object.
virtual std::string TargetNodeID()
Gets the GUID ID of the node that is being stimulated.
Declares the bounding box class.
Declares the gain base class.
void Equation(std::string strVal)
Sets the post-fix Equation.
long m_lBurstStart
The time slice where the burst starts.
A standard xml manipulation class.
Node * m_lpNode
The pointer to this items parent Node. If this is not relevant for this object then this is NULL...
virtual void ResetSimulation()
Resets the simulation back to time 0.
float m_fltCurrentOff
The current to apply when the cycle is off.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
virtual ~CurrentStimulus()
Destructor.
float m_fltBurstOffDuration
Duration of the burst off period in time.
float m_fltInitialActiveCurrent
The initial active current that is used when reseting the simulation.
virtual std::string GetChildString(std::string strElementName)
Gets a string value from the element with the specified name.
virtual AnimatBase * FindByID(std::string strID, bool bThrowError=true)
Searches for the object with the specified ID.
Standard post fix evaluation class.
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.
Declares the current stimulus class.
double Solve()
Solves the equation using the defined variable values.
void SetVariable(std::string strVarName, double dblVal)
Sets the value of a variable.
Base class for body parts and neural network nodes.
virtual void StepSimulation()
Step the simulation for this object.
long m_lBurstOffDuration
Duration of the burst off period in time slices.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
virtual void Deactivate()
Deactivates this item.
float * m_lpExternalCurrent
float m_fltCycleOffDuration
Duration of the cycle off period in time.
int m_iType
Tells the type of current to apply. (Constant, Repetitive, Bursting)
bool Std_IsBlank(std::string strVal)
Trims a string and tests if a string is blank.
virtual float CycleOffDuration()
Gets the off cycle current duration in time.
Declares the data chart manager class.
Declares the rigid body class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual long TimeSlice()
Gets the current time slice.
Declares the structure class.
Declares the odor type class.
CStdPostFixEval * m_lpCurrentOnEval
Pointer to the post-fix equation evaluator.
virtual void Initialize()
Initializes this object.
virtual void Initialize()
Initializes this object.
virtual float BurstOffDuration()
Gets the off burst current duration in time.
long m_lBurstOnDuration
Duration of the burst on period in time slices.
float m_fltActiveCurrent
The active current at that time step.
Declares the simulator class.
Declares the neural module class.
virtual float Time()
Gets the current simulation time in seconds.
std::string Std_ToUpper(std::string strVal)
Converts a string to upper case.
float m_fltCurrentOn
The current to apply when the cycle is on.
Declares the activated item manager class.
Declares the external stimuli manager class.
bool m_bAlwaysActive
Determines whether this item is always active during simulation.
long m_lCycleStart
The time slice where the cycle starts.
std::string m_strType
The type for this object. Examples are Box, Plane, Neuron, etc..
virtual bool AlwaysActive()
Gets whether this item is always active.
Declares the receptive field class.
std::string m_strName
The name for this object.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.
virtual float CycleOnDuration()
Gets the on cycle current duration in time.
CurrentStimulus()
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.