public void CreateNetworkMeanField(NeuronRegime nr, Int32 totalTime)
        {
            this.synapses = new List <GapJunction>();
            Int32 j, i = 0;

            while (i < this.N)
            {
                j = 0;
                while (j < this.N)
                {
                    if (i != j)
                    {
                        this.synapses.Add(new GapJunction(this.neurons[i], this.neurons[j], this.synG));
                        this.neurons[j].AddInput(this.synapses.Last());
                    }
                    j++;
                }
                i++;
            }
            this.nSyn = this.synapses.Count;
            Double[] ic = this.neurons[0].ResetToFP();
            Random   r  = new Random();

            this.neurons.ForEach(n => n.SetIC(ic.Select(x => x * r.NextDouble()).ToArray())); // randomizing IC for all neurons
        }
 public void Reset(NeuronRegime nr, Int32 totalTime)
 {
     // resets network
     //this.synapses.ForEach(s => s.Reset());
     //this.neurons.ForEach(n => n.Reset(nr, totalTime));
     this.neuReg    = nr;
     this.totalTime = totalTime;
     this.Initialize();
 }
 public ModelSimulator(NeuronRegime nr)
 {
     this.neuronRegime  = nr;
     this.KTzLogMap     = new KTzLogModel(nr);
     this.KTzTanhMap    = new KTzTanhModel(nr);
     this.RulkovMap     = new RulkovModel(nr);
     this.IzhikevichMap = new IzhikevichModel(nr);
     this.HHLeechODE    = new HHLeechModel(nr);
     this.HHStdODE      = new HHStdModel(nr);
     this.ResetModels();
 }
示例#4
0
 public override void Reset(NeuronRegime nr, Int32 totalTime)
 {
     this.ts_per_ms = 100.0 / 10.0;
     this.transient = 1000; // in ts
     this.dt        = 0.1;
     if (nr == NeuronRegime.Bursting)
     {
         this.SetBurstingParam();
     }
     else
     {
         this.SetExcitableParam();
     }
 }
        private void CreateNeurons(NeuronType neut, NeuronRegime nr, Int32 totalTime)
        {
            this.neurons = new List <Neuron>(this.N);
            Int32 i = 0;

            while (i < this.N)
            {
                this.neurons.Add(NeuronFactory.Create(neut, nr, totalTime));
                i++;
            }
            this.ts_per_ms = this.neurons[0].ts_per_ms;
            this.transient = this.neurons[0].transient;
            this.dt        = this.neurons[0].dt;
        }
示例#6
0
        private Dictionary <String, Statistics> tsForFPStat; // one entry for each model

        public ModelSimulator(NeuronRegime nr, Int32 totalTime, Double tolerance, Int32 maxTime, NetworkType nt, Int32 N)
        {
            this.neuronRegime  = nr;
            this.GLExpMap      = new GLExpModel(nr, totalTime);
            this.LIFMap        = new LIFModel(nr, totalTime);
            this.KTzLogMap     = new KTzLogModel(nr, totalTime);
            this.KTzTanhMap    = new KTzTanhModel(nr, totalTime);
            this.RulkovMap     = new RulkovModel(nr, totalTime);
            this.IzhikevichMap = new IzhikevichModel(nr, totalTime);
            this.HHLeechODE    = new HHLeechModel(nr, totalTime);
            this.HHStdODE      = new HHStdModel(nr, totalTime);
            if (nr == NeuronRegime.Excitable)
            {
                this.NetLIFMap        = new NetworkModel(NeuronType.LIF, nr, totalTime, nt, N, 0.1);
                this.NetGLExpMap      = new NetworkModel(NeuronType.GLExp, nr, totalTime, nt, N, 0.1);
                this.NetKTzLogMap     = new NetworkModel(NeuronType.KTzLog, nr, totalTime, nt, N, 0.1);
                this.NetKTzTanhMap    = new NetworkModel(NeuronType.KTzTanh, nr, totalTime, nt, N, 0.04);
                this.NetRulkovMap     = new NetworkModel(NeuronType.Rulkov, nr, totalTime, nt, N, 0.08);
                this.NetIzhikevichMap = new NetworkModel(NeuronType.Izhikevich, nr, totalTime, nt, N, 0.1);
                this.NetHHModelODE    = new NetworkModel(NeuronType.HodgkinHuxley, nr, totalTime, nt, N, 0.05);
            }
            else if (nr == NeuronRegime.Bursting)
            {
                this.NetLIFMap        = new NetworkModel(NeuronType.LIF, nr, totalTime, nt, N, 0.1);
                this.NetGLExpMap      = new NetworkModel(NeuronType.GLExp, nr, totalTime, nt, N, 0.1);
                this.NetKTzLogMap     = new NetworkModel(NeuronType.KTzLog, nr, totalTime, nt, N, 0.0);
                this.NetKTzTanhMap    = new NetworkModel(NeuronType.KTzTanh, nr, totalTime, nt, N, 0.04);
                this.NetRulkovMap     = new NetworkModel(NeuronType.Rulkov, nr, totalTime, nt, N, 0.08);
                this.NetIzhikevichMap = new NetworkModel(NeuronType.Izhikevich, nr, totalTime, nt, N, 0.1);
                this.NetHHModelODE    = new NetworkModel(NeuronType.HodgkinHuxley, nr, totalTime, nt, N, 1.0e-10);
            }
            this.ResetModels(totalTime, tolerance, maxTime);
            this.tsForFixedPointPerModel = new List <Int32>();
            this.tsForFPStat             = new Dictionary <String, Statistics>(5);
            this.tsForFPStat.Add(this.LIFMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.GLExpMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.KTzLogMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.KTzTanhMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.IzhikevichMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.RulkovMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.HHStdODE.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetLIFMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetGLExpMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetKTzLogMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetKTzTanhMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetRulkovMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetIzhikevichMap.ToString(), new Statistics());
            this.tsForFPStat.Add(this.NetHHModelODE.ToString(), new Statistics());
        }
        public void CreateNetworkLinear(NeuronRegime nr, Int32 totalTime)
        {
            this.synapses = new List <GapJunction>();
            Int32 i = 1;

            while (i < this.N)
            {
                this.synapses.Add(new GapJunction(this.neurons[i - 1], this.neurons[i], this.synG));
                this.neurons[i].AddInput(this.synapses.Last());
                i++;
            }
            this.nSyn = this.synapses.Count;
            this.neurons.ForEach(n => n.ResetToFP()); // only neuron 0 has activity in t = 0
            this.neurons[0].Reset(nr, totalTime);
        }
示例#8
0
 public static Neuron Create(NeuronType nt, NeuronRegime nr, Int32 totalTime)
 {
     if (nt == NeuronType.HodgkinHuxley)
     {
         if (nr == NeuronRegime.Bursting)
         {
             return(new HHLeechModel(nr, totalTime));
         }
         else if (nr == NeuronRegime.Excitable)
         {
             return(new HHStdModel(nr, totalTime));
         }
         else
         {
             throw new ArgumentOutOfRangeException("Unrecognized NeuronRegime");
         }
     }
     else if (nt == NeuronType.Rulkov)
     {
         return(new RulkovModel(nr, totalTime));
     }
     else if (nt == NeuronType.Izhikevich)
     {
         return(new IzhikevichModel(nr, totalTime));
     }
     else if (nt == NeuronType.KTzTanh)
     {
         return(new KTzTanhModel(nr, totalTime));
     }
     else if (nt == NeuronType.KTzLog)
     {
         return(new KTzLogModel(nr, totalTime));
     }
     else if (nt == NeuronType.GLExp)
     {
         return(new GLExpModel(nr, totalTime));
     }
     else if (nt == NeuronType.LIF)
     {
         return(new LIFModel(nr, totalTime));
     }
     else
     {
         throw new ArgumentOutOfRangeException("Unrecognized NeuronType");
     }
 }
示例#9
0
 public override void Reset(NeuronRegime nr, Int32 totalTime)
 {
     this.initState = new Double[4];
     this.currState = new Double[4];
     this.c1        = new Double[4];
     this.c2        = new Double[4];
     this.c3        = new Double[4];
     this.c4        = new Double[4];
     this.dydt      = new Double[4];
     this.dt        = 0.01;
     this.ts_per_ms = 1 / this.dt;
     this.transient = 100; // in ms
     if (nr == NeuronRegime.Bursting)
     {
         this.SetBurstingParam();
     }
     else
     {
         this.SetExcitableParam();
     }
 }
 public NetworkModel(NeuronType neut, NeuronRegime nr, Int32 totalTime, NetworkType nt, Int32 N, Double synG)
 {
     this.isNetwork = true;
     this.netType   = nt;
     this.neuType   = neut;
     this.neuReg    = nr;
     this.totalTime = totalTime;
     this.N         = N;
     this.synG      = synG;
     if (nt == NetworkType.Linear)
     {
         this.CreateNetwork = this.CreateNetworkLinear;
     }
     else if (nt == NetworkType.MeanField)
     {
         this.CreateNetwork = this.CreateNetworkMeanField;
     }
     else
     {
         throw new ArgumentOutOfRangeException("Unrecognized NetworkType");
     }
     this.Initialize();
 }
示例#11
0
        /*public Double dt { get; private set; } // the step of the integration
         * public Double ts_per_ms { get; private set; }
         * public Int32 transient { get; private set; }*/

        public HHStdModel(NeuronRegime nr, Int32 totalTime)
        {
            this.Reset(nr, totalTime);
        }
示例#12
0
        /*public Double dt { get; private set; } // the step of the integration
         * public Double ts_per_ms { get; private set; }
         * public Int32 transient { get; private set; }*/

        public RulkovModel(NeuronRegime nr, Int32 totalTime)
        {
            this.Reset(nr, totalTime);
        }
示例#13
0
        /*public Double dt { get; private set; } // the step of the integration
         * public Double ts_per_ms { get; private set; }
         * public Int32 transient { get; private set; }*/

        public IzhikevichModel(NeuronRegime nr, Int32 totalTime)
        {
            this.Reset(nr, totalTime);
        }
示例#14
0
        /*public Double dt { get; private set; } // the step of the integration
         * public Double ts_per_ms { get; private set; }
         * public Int32 transient { get; private set; }*/

        public KTzTanhModel(NeuronRegime nr, Int32 totalTime)
        {
            this.Reset(nr, totalTime);
        }
示例#15
0
        /*public Double dt { get; private set; } // the step of the integration
         * public Double ts_per_ms { get; private set; }
         * public Int32 transient { get; private set; }*/

        public GLExpModel(NeuronRegime nr, Int32 totalTime)
        {
            this.Reset(nr, totalTime);
            this.rand = new System.Random();
        }
示例#16
0
 public abstract void Reset(NeuronRegime nr, Int32 totalTime);