//Constructors
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="weightCfg">The configuration of the synapse's weight.</param>
 /// <param name="plasticityCfg">The configuration of the synapse's plasticity.</param>
 public SpikingSourceATIndifferentSettings(URandomValueSettings weightCfg = null,
                                           PlasticityATIndifferentSettings plasticityCfg = null
                                           )
 {
     WeightCfg     = weightCfg == null ? new URandomValueSettings(DefaultMinWeight, DefaultMaxWeight) : (URandomValueSettings)weightCfg.DeepClone();
     PlasticityCfg = plasticityCfg == null ? new PlasticityATIndifferentSettings() : (PlasticityATIndifferentSettings)plasticityCfg.DeepClone();
     Check();
     return;
 }
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">A xml element containing the configuration data.</param>
        public SpikingSourceATIndifferentSettings(XElement elem)
        {
            //Validation
            XElement settingsElem = Validate(elem, XsdTypeName);
            //Parsing
            XElement weightSettingsElem = settingsElem.Elements("weight").FirstOrDefault();

            WeightCfg = weightSettingsElem == null ? new URandomValueSettings(DefaultMinWeight, DefaultMaxWeight) : new URandomValueSettings(weightSettingsElem);
            XElement plasticitySettingsElem = settingsElem.Elements("plasticity").FirstOrDefault();

            PlasticityCfg = plasticitySettingsElem == null ? new PlasticityATIndifferentSettings() : new PlasticityATIndifferentSettings(plasticitySettingsElem);
            Check();
            return;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public PlasticityATIndifferentSettings(PlasticityATIndifferentSettings source)
     : this(source.DynamicsCfg)
 {
     return;
 }