Example #1
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="recoveryTimeScale">Time scale of the recovery variable</param>
 /// <param name="recoverySensitivity">Sensitivity of the recovery variable to the subthreshold fluctuations of the membrane potential</param>
 /// <param name="recoveryReset">After-spike reset of the recovery variable</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 /// <param name="stimuliDuration">Duration of the stimulation</param>
 public IzhikevichIFSettings(URandomValueSettings recoveryTimeScale   = null,
                             URandomValueSettings recoverySensitivity = null,
                             URandomValueSettings recoveryReset       = null,
                             RandomValueSettings restV            = null,
                             RandomValueSettings resetV           = null,
                             RandomValueSettings firingThresholdV = null,
                             int refractoryPeriods            = ActivationFactory.DefaultRefractoryPeriods,
                             ODENumSolver.Method solverMethod = ActivationFactory.DefaultSolverMethod,
                             int solverCompSteps    = ActivationFactory.DefaultSolverCompSteps,
                             double stimuliDuration = ActivationFactory.DefaultStimuliDuration
                             )
 {
     RecoveryTimeScale   = URandomValueSettings.CloneOrDefault(recoveryTimeScale, TypicalRecoveryTimeScale);
     RecoverySensitivity = URandomValueSettings.CloneOrDefault(recoverySensitivity, TypicalRecoverySensitivity);
     RecoveryReset       = URandomValueSettings.CloneOrDefault(recoveryReset, TypicalRecoveryReset);
     RestV             = RandomValueSettings.CloneOrDefault(restV, TypicalRestV);
     ResetV            = RandomValueSettings.CloneOrDefault(resetV, TypicalResetV);
     FiringThresholdV  = RandomValueSettings.CloneOrDefault(firingThresholdV, TypicalFiringThresholdV);
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     StimuliDuration   = stimuliDuration;
     Check();
     return;
 }
Example #2
0
 /// <summary>
 /// Constructs an initialized instance
 /// </summary>
 /// <param name="restV">Membrane rest potential</param>
 /// <param name="resetV">Membrane reset potential</param>
 /// <param name="firingThresholdV">Firing threshold</param>
 /// <param name="refractoryPeriods">Refractory periods</param>
 /// <param name="solvingMethod">ODE numerical solver method</param>
 /// <param name="stepTimeScale">Computation step time scale</param>
 /// <param name="subSteps">Computation sub-steps</param>
 /// <param name="numOfEvolvingVars">Number of evolving variables</param>
 /// <param name="inputCurrentCoeff">Coefficient of the current</param>
 /// <param name="membranePotentialCoeff">Coefficient of the membrane potential</param>
 protected ODESpikingMembrane(double restV,
                              double resetV,
                              double firingThresholdV,
                              int refractoryPeriods,
                              ODENumSolver.Method solvingMethod,
                              double stepTimeScale,
                              int subSteps,
                              int numOfEvolvingVars,
                              double inputCurrentCoeff      = 1d,
                              double membranePotentialCoeff = 1d
                              )
 {
     _restV                     = restV;
     _resetV                    = resetV;
     _minV                      = Math.Min(_resetV, _restV);
     _initialV                  = _resetV;
     _firingThresholdV          = firingThresholdV;
     _refractoryPeriods         = refractoryPeriods;
     _evolVars                  = new Vector(numOfEvolvingVars);
     _solvingMethod             = solvingMethod;
     _stepTimeScale             = stepTimeScale;
     _subSteps                  = subSteps;
     _evolVars[VarMembraneVIdx] = _initialV;
     _inRefractory              = false;
     _refractoryPeriod          = 0;
     _lastSpike                 = false;
     _currentCoeff              = inputCurrentCoeff;
     _potentialCoeff            = membranePotentialCoeff;
     _stateRange                = new Interval(_potentialCoeff * Math.Min(_resetV, _restV), _potentialCoeff * _firingThresholdV);
     return;
 }
Example #3
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="recoveryTimeScale">Time scale of the recovery variable</param>
 /// <param name="recoverySensitivity">Sensitivity of the recovery variable to the subthreshold fluctuations of the membrane potential</param>
 /// <param name="recoveryReset">After-spike reset of the recovery variable</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public IzhikevichIF(double stimuliCoeff,
                     double recoveryTimeScale,
                     double recoverySensitivity,
                     double recoveryReset,
                     double restV,
                     double resetV,
                     double firingThresholdV,
                     int refractoryPeriods,
                     ODENumSolver.Method solverMethod,
                     int solverCompSteps
                     )
     : base(restV,
            resetV,
            firingThresholdV,
            refractoryPeriods,
            stimuliCoeff,
            solverMethod,
            1,
            solverCompSteps,
            2
            )
 {
     _recoveryTimeScale     = recoveryTimeScale;
     _recoverySensitivity   = recoverySensitivity;
     _recoveryReset         = recoveryReset;
     _evolVars[VarRecovery] = (_recoverySensitivity * _evolVars[VarMembraneVIdx]);
     return;
 }
Example #4
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public LeakyIF(double timeScale,
                double resistance,
                double restV,
                double resetV,
                double firingThresholdV,
                int refractoryPeriods,
                ODENumSolver.Method solverMethod,
                int solverCompSteps
                )
     : base(restV,
            resetV,
            firingThresholdV,
            refractoryPeriods,
            solverMethod,
            1,
            solverCompSteps,
            1,
            100,
            1
            )
 {
     _timeScale  = timeScale;
     _resistance = resistance;
     return;
 }
Example #5
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <remarks>
 /// The arguments are in RandomValue form to allow their dynamic random initialization within the specified ranges.
 /// </remarks>
 /// <param name="timeScale">The membrane time scale (ms).</param>
 /// <param name="resistance">The membrane resistance (Mohm).</param>
 /// <param name="restV">The membrane rest potential (mV).</param>
 /// <param name="resetV">The membrane reset potential (mV).</param>
 /// <param name="rheobaseV">The membrane rheobase threshold (mV).</param>
 /// <param name="firingThresholdV">The membrane firing threshold (mV).</param>
 /// <param name="sharpnessDeltaT">The sharpness of membrane potential change (mV).</param>
 /// <param name="refractoryPeriods">The number of after-spike computation cycles while an input stimuli to be ignored (cycles).</param>
 /// <param name="solverMethod">The ODE numerical solver method to be used.</param>
 /// <param name="solverCompSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="stimuliDuration">The duration of the membrane stimulation (ms).</param>
 public AFSpikingExpIFSettings(URandomValueSettings timeScale       = null,
                               URandomValueSettings resistance      = null,
                               RandomValueSettings restV            = null,
                               RandomValueSettings resetV           = null,
                               RandomValueSettings rheobaseV        = null,
                               RandomValueSettings firingThresholdV = null,
                               URandomValueSettings sharpnessDeltaT = null,
                               int refractoryPeriods            = ActivationFactory.DefaultRefractoryPeriods,
                               ODENumSolver.Method solverMethod = ActivationFactory.DefaultSolverMethod,
                               int solverCompSteps    = ActivationFactory.DefaultSolverCompSteps,
                               double stimuliDuration = ActivationFactory.DefaultStimuliDuration
                               )
 {
     TimeScale         = URandomValueSettings.CloneOrCreate(timeScale, TypicalTimeScale);
     Resistance        = URandomValueSettings.CloneOrCreate(resistance, TypicalResistance);
     RestV             = RandomValueSettings.CloneOrCreate(restV, TypicalRestV);
     ResetV            = RandomValueSettings.CloneOrCreate(resetV, TypicalResetV);
     RheobaseV         = RandomValueSettings.CloneOrCreate(rheobaseV, TypicalRheobaseV);
     FiringThresholdV  = RandomValueSettings.CloneOrCreate(firingThresholdV, TypicalFiringThresholdV);
     SharpnessDeltaT   = URandomValueSettings.CloneOrCreate(sharpnessDeltaT, TypicalSharpnessDeltaT);
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     StimuliDuration   = stimuliDuration;
     Check();
     return;
 }
Example #6
0
 /// <summary>
 /// Constructs an initialized instance
 /// </summary>
 /// <param name="restV">Membrane rest voltage</param>
 /// <param name="resetV">Membrane reset voltage</param>
 /// <param name="firingThresholdV">Firing threshold</param>
 /// <param name="refractoryPeriods">Refractory periods</param>
 /// <param name="stimuliCoeff">Input stimuli coefficient</param>
 /// <param name="solvingMethod">ODE numerical solver method</param>
 /// <param name="stepTimeScale">Computation step time scale</param>
 /// <param name="subSteps">Computation sub-steps</param>
 /// <param name="numOfEvolvingVars">Number of evolving variables</param>
 protected ODESpikingMembrane(double restV,
                              double resetV,
                              double firingThresholdV,
                              int refractoryPeriods,
                              double stimuliCoeff,
                              ODENumSolver.Method solvingMethod,
                              double stepTimeScale,
                              int subSteps,
                              int numOfEvolvingVars
                              )
 {
     _restV                     = restV;
     _resetV                    = resetV;
     _firingThresholdV          = firingThresholdV;
     _refractoryPeriods         = refractoryPeriods;
     _stimuliCoeff              = stimuliCoeff;
     _stateRange                = new Interval(Math.Min(_resetV, _restV), _firingThresholdV);
     _evolVars                  = new Vector(numOfEvolvingVars);
     _solvingMethod             = solvingMethod;
     _stepTimeScale             = stepTimeScale;
     _subSteps                  = subSteps;
     _evolVars[VarMembraneVIdx] = _resetV;
     _inRefractory              = false;
     _refractoryPeriod          = 0;
     return;
 }
Example #7
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <remarks>
 /// The arguments are in RandomValue form to allow their dynamic random initialization within the specified ranges.
 /// </remarks>
 /// <param name="timeScale">The membrane time scale (ms).</param>
 /// <param name="resistance">The membrane resistance (Mohm).</param>
 /// <param name="restV">The membrane rest potential (mV).</param>
 /// <param name="resetV">The membrane reset potential (mV).</param>
 /// <param name="rheobaseV">The membrane rheobase threshold (mV).</param>
 /// <param name="firingThresholdV">The membrane firing threshold (mV).</param>
 /// <param name="sharpnessDeltaT">The sharpness of membrane potential change (mV).</param>
 /// <param name="adaptationVoltageCoupling">The adaptation voltage coupling (nS).</param>
 /// <param name="adaptationTimeConstant">The adaptation time constant (ms).</param>
 /// <param name="adaptationSpikeTriggeredIncrement">The spike triggered adaptation increment (pA).</param>
 /// <param name="solverMethod">The ODE numerical solver method to be used.</param>
 /// <param name="solverCompSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="stimuliDuration">The duration of the membrane stimulation (ms).</param>
 public AFSpikingAdExpIFSettings(URandomValueSettings timeScale                         = null,
                                 URandomValueSettings resistance                        = null,
                                 RandomValueSettings restV                              = null,
                                 RandomValueSettings resetV                             = null,
                                 RandomValueSettings rheobaseV                          = null,
                                 RandomValueSettings firingThresholdV                   = null,
                                 URandomValueSettings sharpnessDeltaT                   = null,
                                 URandomValueSettings adaptationVoltageCoupling         = null,
                                 URandomValueSettings adaptationTimeConstant            = null,
                                 URandomValueSettings adaptationSpikeTriggeredIncrement = null,
                                 ODENumSolver.Method solverMethod                       = ActivationFactory.DefaultSolverMethod,
                                 int solverCompSteps    = ActivationFactory.DefaultSolverCompSteps,
                                 double stimuliDuration = ActivationFactory.DefaultStimuliDuration
                                 )
 {
     TimeScale                         = URandomValueSettings.CloneOrCreate(timeScale, TypicalTimeScale);
     Resistance                        = URandomValueSettings.CloneOrCreate(resistance, TypicalResistance);
     RestV                             = RandomValueSettings.CloneOrCreate(restV, TypicalRestV);
     ResetV                            = RandomValueSettings.CloneOrCreate(resetV, TypicalResetV);
     RheobaseV                         = RandomValueSettings.CloneOrCreate(rheobaseV, TypicalRheobaseV);
     FiringThresholdV                  = RandomValueSettings.CloneOrCreate(firingThresholdV, TypicalFiringThresholdV);
     SharpnessDeltaT                   = URandomValueSettings.CloneOrCreate(sharpnessDeltaT, TypicalSharpnessDeltaT);
     AdaptationVoltageCoupling         = URandomValueSettings.CloneOrCreate(adaptationVoltageCoupling, TypicalAdaptationVoltageCoupling);
     AdaptationTimeConstant            = URandomValueSettings.CloneOrCreate(adaptationTimeConstant, TypicalAdaptationTimeConstant);
     AdaptationSpikeTriggeredIncrement = URandomValueSettings.CloneOrCreate(adaptationSpikeTriggeredIncrement, TypicalAdaptationSpikeTriggeredIncrement);
     SolverMethod                      = solverMethod;
     SolverCompSteps                   = solverCompSteps;
     StimuliDuration                   = stimuliDuration;
     Check();
     return;
 }
Example #8
0
 /// <summary>
 /// Constructs an initialized instance
 /// </summary>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="rheobaseV">Membrane rheobase threshold (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="sharpnessDeltaT">Sharpness of membrane potential change (mV)</param>
 /// <param name="adaptationVoltageCoupling">Adaptation voltage coupling (nS)</param>
 /// <param name="adaptationTimeConstant">Adaptation time constant (ms)</param>
 /// <param name="adaptationSpikeTriggeredIncrement">Spike triggered adaptation increment (pA)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public AdExpIF(double timeScale,
                double resistance,
                double restV,
                double resetV,
                double rheobaseV,
                double firingThresholdV,
                double sharpnessDeltaT,
                double adaptationVoltageCoupling,
                double adaptationTimeConstant,
                double adaptationSpikeTriggeredIncrement,
                ODENumSolver.Method solverMethod,
                int solverCompSteps
                )
     : base(PhysUnit.ToBase(restV, PhysUnit.MetricPrefix.Milli),
            PhysUnit.ToBase(resetV, PhysUnit.MetricPrefix.Milli),
            PhysUnit.ToBase(firingThresholdV, PhysUnit.MetricPrefix.Milli),
            0,
            solverMethod,
            PhysUnit.ToBase(1, PhysUnit.MetricPrefix.Milli),
            solverCompSteps,
            2,
            PhysUnit.FromBase(1d, PhysUnit.MetricPrefix.Giga),
            PhysUnit.FromBase(1d, PhysUnit.MetricPrefix.Milli)
            )
 {
     _timeScale                         = PhysUnit.ToBase(timeScale, PhysUnit.MetricPrefix.Milli);
     _resistance                        = PhysUnit.ToBase(resistance, PhysUnit.MetricPrefix.Mega);
     _rheobaseV                         = PhysUnit.ToBase(rheobaseV, PhysUnit.MetricPrefix.Milli);
     _sharpnessDeltaT                   = PhysUnit.ToBase(sharpnessDeltaT, PhysUnit.MetricPrefix.Milli);
     _adaptationVoltageCoupling         = PhysUnit.ToBase(adaptationVoltageCoupling, PhysUnit.MetricPrefix.Nano);
     _adaptationTimeConstant            = PhysUnit.ToBase(adaptationTimeConstant, PhysUnit.MetricPrefix.Milli);
     _spikeTriggeredAdaptationIncrement = PhysUnit.ToBase(adaptationSpikeTriggeredIncrement, PhysUnit.MetricPrefix.Piko);
     _evolVars[VarAdaptationOmegaIdx]   = 0;
     return;
 }
Example #9
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="rheobaseV">Membrane rheobase threshold (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="sharpnessDeltaT">Sharpness of membrane potential change (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public ExpIFSettings(double stimuliCoeff,
                      RandomValueSettings timeScale,
                      RandomValueSettings resistance,
                      RandomValueSettings restV,
                      RandomValueSettings resetV,
                      RandomValueSettings rheobaseV,
                      RandomValueSettings firingThresholdV,
                      RandomValueSettings sharpnessDeltaT,
                      int refractoryPeriods,
                      ODENumSolver.Method solverMethod,
                      int solverCompSteps
                      )
 {
     StimuliCoeff      = stimuliCoeff;
     TimeScale         = timeScale.DeepClone();
     Resistance        = resistance.DeepClone();
     RestV             = restV.DeepClone();
     ResetV            = resetV.DeepClone();
     RheobaseV         = rheobaseV.DeepClone();
     FiringThresholdV  = firingThresholdV.DeepClone();
     SharpnessDeltaT   = sharpnessDeltaT.DeepClone();
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }
Example #10
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="rheobaseV">Membrane rheobase threshold (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="sharpnessDeltaT">Sharpness of membrane potential change (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public ExpIF(double stimuliCoeff,
              double timeScale,
              double resistance,
              double restV,
              double resetV,
              double rheobaseV,
              double firingThresholdV,
              double sharpnessDeltaT,
              int refractoryPeriods,
              ODENumSolver.Method solverMethod,
              int solverCompSteps
              )
     : base(restV,
            resetV,
            firingThresholdV,
            refractoryPeriods,
            stimuliCoeff,
            solverMethod,
            1,
            solverCompSteps,
            1
            )
 {
     _timeScale       = timeScale;
     _resistance      = resistance;
     _rheobaseV       = rheobaseV;
     _sharpnessDeltaT = sharpnessDeltaT;
     return;
 }
Example #11
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="timeScale">The membrane time scale (ms).</param>
 /// <param name="resistance">The membrane resistance (Mohm).</param>
 /// <param name="restV">The membrane rest potential (mV).</param>
 /// <param name="resetV">The membrane reset potential (mV).</param>
 /// <param name="firingThresholdV">The membrane firing threshold (mV).</param>
 /// <param name="refractoryPeriods">The number of after-spike computation cycles while an input stimuli to be ignored (cycles).</param>
 /// <param name="solverMethod">The ODE numerical solver method to be used.</param>
 /// <param name="solverCompSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="stimuliDuration">The duration of the membrane stimulation (ms).</param>
 /// <param name="initialVRatio">The membrane initial potential in form of a ratio between 0 and 1, where 0 corresponds to a Min(resetV, restV) potential and 1 corresponds to a firingThreshold.</param>
 public AFSpikingLeakyIF(double timeScale,
                         double resistance,
                         double restV,
                         double resetV,
                         double firingThresholdV,
                         int refractoryPeriods,
                         ODENumSolver.Method solverMethod,
                         int solverCompSteps,
                         double stimuliDuration,
                         double initialVRatio = 0d
                         )
     : base(restV,
            resetV,
            firingThresholdV,
            refractoryPeriods,
            solverMethod,
            stimuliDuration,
            solverCompSteps,
            1,
            10,
            1,
            initialVRatio
            )
 {
     _timeScale  = timeScale;
     _resistance = resistance;
     return;
 }
Example #12
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="rheobaseV">Membrane rheobase threshold (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="sharpnessDeltaT">Sharpness of membrane potential change (mV)</param>
 /// <param name="adaptationVoltageCoupling">Adaptation voltage coupling (nS)</param>
 /// <param name="adaptationTimeConstant">Adaptation time constant (ms)</param>
 /// <param name="adaptationSpikeTriggeredIncrement">Spike triggered adaptation increment (pA)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public AdExpIFSettings(double stimuliCoeff,
     RandomValueSettings timeScale,
     RandomValueSettings resistance,
     RandomValueSettings restV,
     RandomValueSettings resetV,
     RandomValueSettings rheobaseV,
     RandomValueSettings firingThresholdV,
     RandomValueSettings sharpnessDeltaT,
     RandomValueSettings adaptationVoltageCoupling,
     RandomValueSettings adaptationTimeConstant,
     RandomValueSettings adaptationSpikeTriggeredIncrement,
     ODENumSolver.Method solverMethod,
     int solverCompSteps
     )
 {
     StimuliCoeff = stimuliCoeff;
     TimeScale = timeScale.DeepClone();
     Resistance = resistance.DeepClone();
     RestV = restV.DeepClone();
     ResetV = resetV.DeepClone();
     RheobaseV = rheobaseV.DeepClone();
     FiringThresholdV = firingThresholdV.DeepClone();
     SharpnessDeltaT = sharpnessDeltaT.DeepClone();
     AdaptationVoltageCoupling = adaptationVoltageCoupling.DeepClone();
     AdaptationTimeConstant = adaptationTimeConstant.DeepClone();
     AdaptationSpikeTriggeredIncrement = adaptationSpikeTriggeredIncrement.DeepClone();
     SolverMethod = solverMethod;
     SolverCompSteps = solverCompSteps;
     return;
 }
Example #13
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="rheobaseV">Membrane rheobase threshold (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="sharpnessDeltaT">Sharpness of membrane potential change (mV)</param>
 /// <param name="adaptationVoltageCoupling">Adaptation voltage coupling (nS)</param>
 /// <param name="adaptationTimeConstant">Adaptation time constant (ms)</param>
 /// <param name="adaptationSpikeTriggeredIncrement">Spike triggered adaptation increment (pA)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public AdExpIFSettings(RandomValueSettings timeScale                         = null,
                        RandomValueSettings resistance                        = null,
                        RandomValueSettings restV                             = null,
                        RandomValueSettings resetV                            = null,
                        RandomValueSettings rheobaseV                         = null,
                        RandomValueSettings firingThresholdV                  = null,
                        RandomValueSettings sharpnessDeltaT                   = null,
                        RandomValueSettings adaptationVoltageCoupling         = null,
                        RandomValueSettings adaptationTimeConstant            = null,
                        RandomValueSettings adaptationSpikeTriggeredIncrement = null,
                        ODENumSolver.Method solverMethod                      = ODENumSolver.Method.Euler,
                        int solverCompSteps = 2
                        )
 {
     TimeScale                         = RandomValueSettings.CloneOrDefault(timeScale, TypicalTimeScale);
     Resistance                        = RandomValueSettings.CloneOrDefault(resistance, TypicalResistance);
     RestV                             = RandomValueSettings.CloneOrDefault(restV, TypicalRestV);
     ResetV                            = RandomValueSettings.CloneOrDefault(resetV, TypicalResetV);
     RheobaseV                         = RandomValueSettings.CloneOrDefault(rheobaseV, TypicalRheobaseV);
     FiringThresholdV                  = RandomValueSettings.CloneOrDefault(firingThresholdV, TypicalFiringThresholdV);
     SharpnessDeltaT                   = RandomValueSettings.CloneOrDefault(sharpnessDeltaT, TypicalSharpnessDeltaT);
     AdaptationVoltageCoupling         = RandomValueSettings.CloneOrDefault(adaptationVoltageCoupling, TypicalAdaptationVoltageCoupling);
     AdaptationTimeConstant            = RandomValueSettings.CloneOrDefault(adaptationTimeConstant, TypicalAdaptationTimeConstant);
     AdaptationSpikeTriggeredIncrement = RandomValueSettings.CloneOrDefault(adaptationSpikeTriggeredIncrement, TypicalAdaptationSpikeTriggeredIncrement);
     SolverMethod                      = solverMethod;
     SolverCompSteps                   = solverCompSteps;
     return;
 }
Example #14
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="recoveryTimeScale">The time scale of the recovery variable.</param>
 /// <param name="recoverySensitivity">The sensitivity of the recovery variable to the sub-threshold fluctuations of the membrane potential.</param>
 /// <param name="recoveryReset">The after-spike reset of the recovery variable.</param>
 /// <param name="restV">The membrane rest potential (mV).</param>
 /// <param name="resetV">The membrane reset potential (mV).</param>
 /// <param name="firingThresholdV">The membrane firing threshold (mV).</param>
 /// <param name="refractoryPeriods">The number of after-spike computation cycles while an input stimuli to be ignored (cycles).</param>
 /// <param name="solverMethod">The ODE numerical solver method to be used.</param>
 /// <param name="solverCompSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="stimuliDuration">The duration of the membrane stimulation (ms).</param>
 /// <param name="initialVRatio">The membrane initial potential in form of a ratio between 0 and 1, where 0 corresponds to a Min(resetV, restV) potential and 1 corresponds to a firingThreshold.</param>
 public AFSpikingIzhikevichIF(double recoveryTimeScale,
                              double recoverySensitivity,
                              double recoveryReset,
                              double restV,
                              double resetV,
                              double firingThresholdV,
                              int refractoryPeriods,
                              ODENumSolver.Method solverMethod,
                              int solverCompSteps,
                              double stimuliDuration,
                              double initialVRatio = 0d
                              )
     : base(restV,
            resetV,
            firingThresholdV,
            refractoryPeriods,
            solverMethod,
            stimuliDuration,
            solverCompSteps,
            2,
            100,
            1,
            initialVRatio
            )
 {
     _recoveryTimeScale     = recoveryTimeScale;
     _recoverySensitivity   = recoverySensitivity;
     _recoveryReset         = recoveryReset;
     _evolVars[VarRecovery] = (_recoverySensitivity * _evolVars[VarMembraneVIdx]);
     return;
 }
Example #15
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="role">Role of the neuron (excitatory or inhibitory)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public AutoIzhikevichIFSettings(NeuronCommon.NeuronRole role,
                                 int refractoryPeriods,
                                 ODENumSolver.Method solverMethod,
                                 int solverCompSteps
                                 )
 {
     Role = role;
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }
Example #16
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="refractoryPeriods">The number of after-spike computation cycles while an input stimuli to be ignored (cycles).</param>
 /// <param name="solverMethod">The ODE numerical solver method to be used.</param>
 /// <param name="solverCompSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="stimuliDuration">The duration of the membrane stimulation (ms).</param>
 public AFSpikingAutoIzhikevichIFSettings(int refractoryPeriods            = ActivationFactory.DefaultRefractoryPeriods,
                                          ODENumSolver.Method solverMethod = ActivationFactory.DefaultSolverMethod,
                                          int solverCompSteps    = ActivationFactory.DefaultSolverCompSteps,
                                          double stimuliDuration = ActivationFactory.DefaultStimuliDuration
                                          )
 {
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     StimuliDuration   = stimuliDuration;
     Check();
     return;
 }
Example #17
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="role">Role of the neuron (excitatory or inhibitory)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public AutoIzhikevichIFSettings(double stimuliCoeff,
                                 CommonEnums.NeuronRole role,
                                 int refractoryPeriods,
                                 ODENumSolver.Method solverMethod,
                                 int solverCompSteps
                                 )
 {
     StimuliCoeff      = stimuliCoeff;
     Role              = role;
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }
Example #18
0
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="restV">The membrane rest potential.</param>
 /// <param name="resetV">The membrane reset potential.</param>
 /// <param name="firingThresholdV">The firing threshold.</param>
 /// <param name="refractoryPeriods">The number of refractory periods.</param>
 /// <param name="solvingMethod">The ODE numerical solver method to be used.</param>
 /// <param name="stepTimeScale">The ODE computation step time scale.</param>
 /// <param name="subSteps">The number of computation sub-steps of the ODE numerical solver.</param>
 /// <param name="numOfEvolvingVars">The number of inner evolving variables.</param>
 /// <param name="inputCurrentCoeff">The coefficient of the input current.</param>
 /// <param name="membranePotentialCoeff">The coefficient of the membrane potential.</param>
 /// <param name="initialVRatio">The membrane initial potential in form of a ratio between 0 and 1, where 0 corresponds to a Min(resetV, restV) potential and 1 corresponds to a firingThreshold.</param>
 protected AFSpikingODE(double restV,
                        double resetV,
                        double firingThresholdV,
                        int refractoryPeriods,
                        ODENumSolver.Method solvingMethod,
                        double stepTimeScale,
                        int subSteps,
                        int numOfEvolvingVars,
                        double inputCurrentCoeff      = 1d,
                        double membranePotentialCoeff = 1d,
                        double initialVRatio          = 0d
                        )
     : base(restV, resetV, firingThresholdV, refractoryPeriods, numOfEvolvingVars, inputCurrentCoeff, membranePotentialCoeff, initialVRatio)
 {
     _solvingMethod = solvingMethod;
     _stepTimeScale = stepTimeScale;
     _subSteps      = subSteps;
     return;
 }
Example #19
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public LeakyIFSettings(RandomValueSettings timeScale        = null,
                        RandomValueSettings resistance       = null,
                        RandomValueSettings restV            = null,
                        RandomValueSettings resetV           = null,
                        RandomValueSettings firingThresholdV = null,
                        int refractoryPeriods            = 1,
                        ODENumSolver.Method solverMethod = ODENumSolver.Method.Euler,
                        int solverCompSteps = 2
                        )
 {
     TimeScale         = RandomValueSettings.CloneOrDefault(timeScale, TypicalTimeScale);
     Resistance        = RandomValueSettings.CloneOrDefault(resistance, TypicalResistance);
     RestV             = RandomValueSettings.CloneOrDefault(restV, TypicalRestV);
     ResetV            = RandomValueSettings.CloneOrDefault(resetV, TypicalResetV);
     FiringThresholdV  = RandomValueSettings.CloneOrDefault(firingThresholdV, TypicalFiringThresholdV);
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }
Example #20
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="recoveryTimeScale">Time scale of the recovery variable</param>
 /// <param name="recoverySensitivity">Sensitivity of the recovery variable to the subthreshold fluctuations of the membrane potential</param>
 /// <param name="recoveryReset">After-spike reset of the recovery variable</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public IzhikevichIFSettings(RandomValueSettings recoveryTimeScale   = null,
                             RandomValueSettings recoverySensitivity = null,
                             RandomValueSettings recoveryReset       = null,
                             RandomValueSettings restV            = null,
                             RandomValueSettings resetV           = null,
                             RandomValueSettings firingThresholdV = null,
                             int refractoryPeriods            = 1,
                             ODENumSolver.Method solverMethod = ODENumSolver.Method.Euler,
                             int solverCompSteps = 2
                             )
 {
     RecoveryTimeScale   = RandomValueSettings.CloneOrDefault(recoveryTimeScale, TypicalRecoveryTimeScale);
     RecoverySensitivity = RandomValueSettings.CloneOrDefault(recoverySensitivity, TypicalRecoverySensitivity);
     RecoveryReset       = RandomValueSettings.CloneOrDefault(recoveryReset, TypicalRecoveryReset);
     RestV             = RandomValueSettings.CloneOrDefault(restV, TypicalRestV);
     ResetV            = RandomValueSettings.CloneOrDefault(resetV, TypicalResetV);
     FiringThresholdV  = RandomValueSettings.CloneOrDefault(firingThresholdV, TypicalFiringThresholdV);
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }
Example #21
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="timeScale">Membrane time scale (ms)</param>
 /// <param name="resistance">Membrane resistance (Mohm)</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 /// <param name="stimuliDuration">Duration of the stimulation</param>
 public LeakyIFSettings(URandomValueSettings timeScale       = null,
                        URandomValueSettings resistance      = null,
                        RandomValueSettings restV            = null,
                        RandomValueSettings resetV           = null,
                        RandomValueSettings firingThresholdV = null,
                        int refractoryPeriods            = ActivationFactory.DefaultRefractoryPeriods,
                        ODENumSolver.Method solverMethod = ActivationFactory.DefaultSolverMethod,
                        int solverCompSteps    = ActivationFactory.DefaultSolverCompSteps,
                        double stimuliDuration = ActivationFactory.DefaultStimuliDuration
                        )
 {
     TimeScale         = URandomValueSettings.CloneOrDefault(timeScale, TypicalTimeScale);
     Resistance        = URandomValueSettings.CloneOrDefault(resistance, TypicalResistance);
     RestV             = RandomValueSettings.CloneOrDefault(restV, TypicalRestV);
     ResetV            = RandomValueSettings.CloneOrDefault(resetV, TypicalResetV);
     FiringThresholdV  = RandomValueSettings.CloneOrDefault(firingThresholdV, TypicalFiringThresholdV);
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     StimuliDuration   = stimuliDuration;
     Check();
     return;
 }
Example #22
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="stimuliCoeff">Input stimuli coefficient (pA)</param>
 /// <param name="recoveryTimeScale">Time scale of the recovery variable</param>
 /// <param name="recoverySensitivity">Sensitivity of the recovery variable to the subthreshold fluctuations of the membrane potential</param>
 /// <param name="recoveryReset">After-spike reset of the recovery variable</param>
 /// <param name="restV">Membrane rest potential (mV)</param>
 /// <param name="resetV">Membrane reset potential (mV)</param>
 /// <param name="firingThresholdV">Membrane firing threshold (mV)</param>
 /// <param name="refractoryPeriods">Number of after spike computation cycles while an input stimuli is ignored (ms)</param>
 /// <param name="solverMethod">ODE numerical solver method</param>
 /// <param name="solverCompSteps">ODE numerical solver computation steps of the time step</param>
 public IzhikevichIFSettings(double stimuliCoeff,
                             RandomValueSettings recoveryTimeScale,
                             RandomValueSettings recoverySensitivity,
                             RandomValueSettings recoveryReset,
                             RandomValueSettings restV,
                             RandomValueSettings resetV,
                             RandomValueSettings firingThresholdV,
                             int refractoryPeriods,
                             ODENumSolver.Method solverMethod,
                             int solverCompSteps
                             )
 {
     StimuliCoeff        = stimuliCoeff;
     RecoveryTimeScale   = recoveryTimeScale.DeepClone();
     RecoverySensitivity = recoverySensitivity.DeepClone();
     RecoveryReset       = recoveryReset.DeepClone();
     RestV             = restV.DeepClone();
     ResetV            = resetV.DeepClone();
     FiringThresholdV  = firingThresholdV.DeepClone();
     RefractoryPeriods = refractoryPeriods;
     SolverMethod      = solverMethod;
     SolverCompSteps   = solverCompSteps;
     return;
 }