示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 public bool SetConceptValue(Concept concept, float value)
 {
     try
     {
         ConceptList[ConceptList.IndexOf(concept)].Value = value;
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#5
0
        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");
        }
示例#6
0
        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);
        }
示例#7
0
 private void IndividualListSelected(object sender, SelectionChangedEventArgs e)
 {
     ConceptList.UnselectAll();
 }
示例#8
0
 public bool ContainsConcept(Concept c)
 {
     return(ConceptList.Contains(c));
 }
示例#9
0
 public void AddConcept(Concept c)
 {
     ConceptList.Add(c);
 }