Exemplo n.º 1
0
 //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 SynapseATInputSettings(Synapse.SynapticDelayMethod delayMethod = DefaultDelayMethod,
                               int maxDelay = DefaultMaxDelay,
                               AnalogSourceSettings analogSourceCfg          = null,
                               SpikingSourceATInputSettings spikingSourceCfg = null
                               )
 {
     DelayMethod      = delayMethod;
     MaxDelay         = maxDelay;
     AnalogSourceCfg  = analogSourceCfg == null ? new AnalogSourceSettings() : (AnalogSourceSettings)analogSourceCfg.DeepClone();
     SpikingSourceCfg = spikingSourceCfg == null ? new SpikingSourceATInputSettings() : (SpikingSourceATInputSettings)spikingSourceCfg.DeepClone();
     Check();
     return;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">Xml element containing the initialization settings</param>
        public SynapseATInputSettings(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 SpikingSourceATInputSettings() : new SpikingSourceATInputSettings(spikingSourceElem);
            Check();
            return;
        }
Exemplo n.º 3
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public SpikingSourceATInputSettings(SpikingSourceATInputSettings source)
     : this(source.WeightCfg, source.PlasticityCfg)
 {
     return;
 }