Exemple #1
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="weightCfg">Synapse's weight settings</param>
 /// <param name="plasticityCfg">Synapse's plasticity configuration</param>
 public SpikingSourceSTInputSettings(URandomValueSettings weightCfg          = null,
                                     PlasticitySTInputSettings plasticityCfg = null
                                     )
 {
     WeightCfg     = weightCfg == null ? new URandomValueSettings(DefaultMinWeight, DefaultMaxWeight) : (URandomValueSettings)weightCfg.DeepClone();
     PlasticityCfg = plasticityCfg == null ? new PlasticitySTInputSettings() : (PlasticitySTInputSettings)plasticityCfg.DeepClone();
     Check();
     return;
 }
Exemple #2
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">Xml element containing the initialization settings</param>
        public SpikingSourceSTInputSettings(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 PlasticitySTInputSettings() : new PlasticitySTInputSettings(plasticitySettingsElem);
            Check();
            return;
        }
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public PlasticitySTInputSettings(PlasticitySTInputSettings source)
     : this(source.DynamicsCfg)
 {
     return;
 }