//Constructors /// <summary> /// Creates an initialized instance /// </summary> /// <param name="delayMethod">Specifies how to decide synaptic delay</param> /// <param name="maxDelay">Maximum delay of the signal</param> /// <param name="analogSourceCfg">Configuration of synapse having analog source neuron</param> /// <param name="spikingSourceCfg">Configuration of synapse having spiking source neuron</param> public SynapseSTInputSettings(Synapse.SynapticDelayMethod delayMethod = DefaultDelayMethod, int maxDelay = DefaultMaxDelay, AnalogSourceSettings analogSourceCfg = null, SpikingSourceSTInputSettings spikingSourceCfg = null ) { DelayMethod = delayMethod; MaxDelay = maxDelay; AnalogSourceCfg = analogSourceCfg == null ? new AnalogSourceSettings() : (AnalogSourceSettings)analogSourceCfg.DeepClone(); SpikingSourceCfg = spikingSourceCfg == null ? new SpikingSourceSTInputSettings() : (SpikingSourceSTInputSettings)spikingSourceCfg.DeepClone(); Check(); return; }
/// <summary> /// Creates an initialized instance. /// </summary> /// <param name="elem">Xml element containing the initialization settings</param> public SynapseSTInputSettings(XElement elem) { //Validation XElement settingsElem = Validate(elem, XsdTypeName); //Parsing DelayMethod = (Synapse.SynapticDelayMethod)Enum.Parse(typeof(Synapse.SynapticDelayMethod), settingsElem.Attribute("delayMethod").Value, true); MaxDelay = int.Parse(settingsElem.Attribute("maxDelay").Value, CultureInfo.InvariantCulture); XElement analogSourceElem = settingsElem.Elements("analogSource").FirstOrDefault(); AnalogSourceCfg = analogSourceElem == null ? new AnalogSourceSettings() : new AnalogSourceSettings(analogSourceElem); XElement spikingSourceElem = settingsElem.Elements("spikingSource").FirstOrDefault(); SpikingSourceCfg = spikingSourceElem == null ? new SpikingSourceSTInputSettings() : new SpikingSourceSTInputSettings(spikingSourceElem); Check(); return; }
/// <summary> /// The deep copy constructor /// </summary> /// <param name="source">Source instance</param> public SpikingSourceSTInputSettings(SpikingSourceSTInputSettings source) : this(source.WeightCfg, source.PlasticityCfg) { return; }