/// <inheritdoc/> public override XElement GetXml(string rootElemName, bool suppressDefaults) { XElement rootElem = new XElement(rootElemName, new XAttribute("name", Name), new XAttribute("relShare", RelShare.ToString(CultureInfo.InvariantCulture)), ActivationCfg.GetXml(suppressDefaults) ); if (!suppressDefaults || !IsDefaultFiringThreshold) { rootElem.Add(new XAttribute("firingThreshold", FiringThreshold.ToString(CultureInfo.InvariantCulture))); } if (!suppressDefaults || !IsDefaultThresholdMaxRefDeepness) { rootElem.Add(new XAttribute("thresholdMaxRefDeepness", ThresholdMaxRefDeepness.ToString(CultureInfo.InvariantCulture))); } if (BiasCfg != null) { rootElem.Add(BiasCfg.GetXml("bias", suppressDefaults)); } if (RetainmentCfg != null) { rootElem.Add(RetainmentCfg.GetXml(suppressDefaults)); } rootElem.Add(PredictorsCfg.GetXml(suppressDefaults)); Validate(rootElem, XsdTypeName); return(rootElem); }
/// <inheritdoc/> public override XElement GetXml(string rootElemName, bool suppressDefaults) { XElement rootElem = new XElement(rootElemName, new XAttribute("name", Name), new XAttribute("relShare", RelShare.ToString(CultureInfo.InvariantCulture)), ActivationCfg.GetXml(suppressDefaults) ); if (!suppressDefaults || !IsDefaultHomogenousExcitabilityCfg) { rootElem.Add(HomogenousExcitabilityCfg.GetXml(suppressDefaults)); } if (BiasCfg != null) { rootElem.Add(BiasCfg.GetXml("bias", suppressDefaults)); } rootElem.Add(PredictorsCfg.GetXml(suppressDefaults)); Validate(rootElem, XsdTypeName); return(rootElem); }