public float DefuzzyConcept(Concept concept) { if (!ConceptList.Contains(concept)) { throw new System.Exception("@Fuzzy Exception - No concept of name: " + concept.name + "found inside related concepts"); } return(concept.Defuzzyfication(PrecisionValue)); }
public void RemoveConcept(int index) { if (index < 0 || index >= ConceptList.Count) { throw new System.Exception("@Fuzzy behaviour - index out of bounds in concepList. Cannot remove concept of index: " + index); } ConceptList.RemoveAt(index); }
private StringBuilder CreateKeywordQueryBuilder(ConceptList conceptList) { var searchQueryBuilder = new StringBuilder(); foreach (var concept in conceptList.Concepts) { searchQueryBuilder.Append(concept.name).Append(" "); } searchQueryBuilder.Length -= 1; return(searchQueryBuilder); }
public bool SetConceptValue(Concept concept, float value) { try { ConceptList[ConceptList.IndexOf(concept)].Value = value; return(true); } catch { return(false); } }
public void RemoveConcept(string name) { foreach (var concept in ConceptList) { if (concept.name == name) { ConceptList.Remove(concept); return; } } throw new System.Exception("@FuzzyBehaviour - could not find concept of name: " + name + ". Removal failed"); }
public string ShowConcept() { var str = ""; foreach (var con in ConceptList) { var number = ConceptList.IndexOf(con) + 1; str = "Концепт " + number + ": " + con.Name + ": \n("; foreach (var term in con.TermList) { str += con.TermList.IndexOf(term) + " - " + term.Name + ";\n"; } str += "): " + con.DegreeOfBelonging + "\n\n"; } return(str); }
private void IndividualListSelected(object sender, SelectionChangedEventArgs e) { ConceptList.UnselectAll(); }
public bool ContainsConcept(Concept c) { return(ConceptList.Contains(c)); }
public void AddConcept(Concept c) { ConceptList.Add(c); }