Exemple #1
0
        protected void AddNeuron(Neuron n, DataTable dt, NeuronConfig cfg)
        {
            DataRow row = dt.NewRow();

            row["n"]        = dt.Rows.Count + 1;
            row["RP"]       = cfg.RestingPotential.ToDisplayValue();
            row["APT"]      = cfg.ActionPotentialThreshold.ToDisplayValue();
            row["APV"]      = cfg.ActionPotentialValue.ToDisplayValue();
            row["RRR"]      = cfg.RefractoryRecoveryRate.ToDisplayValue();
            row["HPO"]      = cfg.HyperPolarizationOvershoot.ToDisplayValue();
            row["RPRR"]     = cfg.RestingPotentialReturnRate.ToDisplayValue();
            row["LKG"]      = "0";
            row["PCOLOR"]   = probeColors[probeColorIdx];
            row["Location"] = new Point(20 + probeColorIdx * 30, pnlNetwork.Height / 2);
            dt.Rows.Add(row);
            rowNeuronMap[row] = n;
        }
Exemple #2
0
        protected void Bind(TrackBar tb, Label lbl, NeuronConfig config, string field)
        {
            Type         t  = config.GetType();
            PropertyInfo pi = t.GetProperty(field, BindingFlags.Instance | BindingFlags.Public);
            int          p  = (int)pi.GetValue(config);
            int          v  = ConvertPotential(p);

            tb.Value         = v;
            lbl.Text         = (v / 10.0).ToString("###.0");
            tb.ValueChanged += (sender, args) =>
            {
                v        = tb.Value;
                lbl.Text = (v / 10.0).ToString("###.0");
                p        = ConvertTrackBar(v);
                pi.SetValue(config, p);
            };
        }
Exemple #3
0
		/// <summary>
		/// Instantiate the neuron with a custom configuration.
		/// </summary>
		public Neuron(NeuronConfig config)
		{
			this.config = config;
			Initialize();
		}
Exemple #4
0
		/// <summary>
		/// Use default configuration for the neuron.
		/// </summary>
		public Neuron()
		{
			config = NeuronConfig.DefaultConfiguration;
			Initialize();
		}
Exemple #5
0
		protected void AddNeuron(Neuron n, DataTable dt, NeuronConfig cfg)
		{
			DataRow row = dt.NewRow();
			row["n"] = dt.Rows.Count + 1;
			row["RP"] = cfg.RestingPotential.ToDisplayValue();
			row["APT"] = cfg.ActionPotentialThreshold.ToDisplayValue();
			row["APV"] = cfg.ActionPotentialValue.ToDisplayValue();
			row["RRR"] = cfg.RefractoryRecoveryRate.ToDisplayValue();
			row["HPO"] = cfg.HyperPolarizationOvershoot.ToDisplayValue();
			row["RPRR"] = cfg.RestingPotentialReturnRate.ToDisplayValue();
			row["LKG"] = "0";
			row["PCOLOR"] = probeColors[probeColorIdx];
			row["Location"] = new Point(20 + probeColorIdx * 30, pnlNetwork.Height / 2);
			dt.Rows.Add(row);
			rowNeuronMap[row] = n;
		}
Exemple #6
0
		protected void Bind(TrackBar tb, Label lbl, NeuronConfig config, string field)
		{
			Type t = config.GetType();
			PropertyInfo pi = t.GetProperty(field, BindingFlags.Instance | BindingFlags.Public);
			int p = (int)pi.GetValue(config);
			int v = ConvertPotential(p);
			tb.Value = v;
			lbl.Text = (v / 10.0).ToString("###.0");
			tb.ValueChanged += (sender, args) =>
				{
					v = tb.Value;
					lbl.Text = (v / 10.0).ToString("###.0");
					p = ConvertTrackBar(v);
					pi.SetValue(config, p);					
				};
		}
Exemple #7
0
 /// <summary>
 /// Instantiate the neuron with a custom configuration.
 /// </summary>
 public Neuron(NeuronConfig config)
 {
     this.config = config;
     Initialize();
 }
Exemple #8
0
 /// <summary>
 /// Use default configuration for the neuron.
 /// </summary>
 public Neuron()
 {
     config = NeuronConfig.DefaultConfiguration;
     Initialize();
 }