public static TSAFuzzySystem loadUFS(this TSAFuzzySystem Approx, string fileName) { XmlDocument Source = new XmlDocument(); Source.Load(fileName); return(Approx.loadUFS(Source)); }
public static IFuzzySystem LoadUFS(string FileName, out FuzzySystemRelisedList.TypeSystem TypeFS) { IFuzzySystem result = null; TypeFS = FuzzySystemRelisedList.TypeSystem.PittsburghClassifier; XmlDocument Source = new XmlDocument(); Source.Load(FileName); XmlNode temp = Source.SelectSingleNode("FuzzySystem"); string typestring = temp.Attributes.GetNamedItem("Type").Value.ToLowerInvariant(); switch (typestring) { case "approximatortakagisugeno": { TSAFuzzySystem TSAFS = new TSAFuzzySystem(LoadLearnFromUFS(Source), LoadTestFromUFS(Source)); TSAFS.loadUFS(Source); result = TSAFS; TypeFS = FuzzySystemRelisedList.TypeSystem.TakagiSugenoApproximate; break; } case "approximatorsingleton": { SAFuzzySystem SAFS = new SAFuzzySystem(LoadLearnFromUFS(Source), LoadTestFromUFS(Source)); SAFS.loadUFS(Source); result = SAFS; TypeFS = FuzzySystemRelisedList.TypeSystem.Singletone; break; } case "classifierpittsburgh": { PCFuzzySystem PCFS = new PCFuzzySystem(LoadLearnFromUFS(Source), LoadTestFromUFS(Source)); PCFS.loadUFS(Source); result = PCFS; TypeFS = FuzzySystemRelisedList.TypeSystem.PittsburghClassifier; break; } } return(result); }