public virtual void AddSetShoulder(string setName, double alphaCut, double ptBeg, double ptEnd, EnumFuzzySetDirection setDir) { lock (this) { moSetList[setName] = new ShoulderFuzzySet(this, setName, alphaCut, ptBeg, ptEnd, setDir); } }
/// <summary> /// Create a Shoulder /// </summary> /// <param name="vFuzzyVar"></param> /// <param name="vsXml"></param> private void CreateShoulder(ContinuousFuzzyRuleVariable vFuzzyVar, string vsXml) { XmlTextReader reader = new XmlTextReader(new StringReader(vsXml)); reader.Read(); string sName = reader.GetAttribute("name"); float fAlpha = float.Parse(reader.GetAttribute("alpha")); float fStart = float.Parse(reader.GetAttribute("start")); float fEnd = float.Parse(reader.GetAttribute("end")); //left = 1, right = 2 EnumFuzzySetDirection eType = (EnumFuzzySetDirection)int.Parse(reader.GetAttribute("type")); vFuzzyVar.AddSetShoulder(sName, fAlpha, fStart, fEnd, eType); reader.Close(); }