Пример #1
0
 /// <summary>
 /// Initializes a new Fuzzy <see cref="InferenceSystem"/>.
 /// </summary>
 /// 
 /// <param name="database">A fuzzy <see cref="Database"/> containing the system linguistic
 /// variables.</param>
 /// <param name="defuzzifier">A defuzzyfier method used to evaluate the numeric otput
 /// of the system.</param>
 /// <param name="normOperator">A <see cref="INorm"/> operator used to evaluate the norms
 /// in the <see cref="InferenceSystem"/>. For more information of the norm evaluation see <see cref="Rule"/>.</param>
 /// <param name="conormOperator">A <see cref="ICoNorm"/> operator used to evaluate the
 /// conorms in the <see cref="InferenceSystem"/>. For more information of the conorm evaluation see <see cref="Rule"/>.</param>
 /// 
 public InferenceSystem( Database database, IDefuzzifier defuzzifier, INorm normOperator, ICoNorm conormOperator )
 {
     this.database = database;
     this.defuzzifier = defuzzifier;
     this.normOperator = normOperator;
     this.conormOperator = conormOperator;
     this.rulebase = new Rulebase( );
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Rule"/> class using as
 /// CoNorm the <see cref="MaximumCoNorm"/> and as Norm the <see cref="MinimumNorm"/>.
 /// </summary>
 /// 
 /// <param name="fuzzyDatabase">A fuzzy <see cref="Database"/> containig the linguistic variables
 /// (see <see cref="LinguisticVariable"/>) that will be used in the <see cref="Rule"/>.</param>
 /// 
 /// <param name="name">Name of this <see cref="Rule"/>.</param>
 /// 
 /// <param name="rule">A string representing the <see cref="Rule"/>. It must be a "IF..THEN"
 /// statement. For a more detailed description see <see cref="Rule"/> class.</param>
 /// 
 public Rule( Database fuzzyDatabase, string name, string rule ) :
     this( fuzzyDatabase, name, rule, new MinimumNorm( ), new MaximumCoNorm( ) )
 {
 }
Пример #3
0
 /// <summary>
 /// Initializes a new Fuzzy <see cref="InferenceSystem"/>.
 /// </summary>
 /// 
 /// <param name="database">A fuzzy <see cref="Database"/> containing the system linguistic variables.</param>
 /// <param name="defuzzifier">A defuzzyfier method used to evaluate the numeric uotput of the system.</param>
 /// 
 public InferenceSystem( Database database, IDefuzzifier defuzzifier )
     : this( database, defuzzifier, new MinimumNorm( ), new MaximumCoNorm( ) )
 {
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Rule"/> class.
        /// </summary>
        /// 
        /// <param name="fuzzyDatabase">A fuzzy <see cref="Database"/> containig the linguistic variables
        /// (see <see cref="LinguisticVariable"/>) that will be used in the Rule.</param>
        /// 
        /// <param name="name">Name of this <see cref="Rule"/>.</param>
        /// 
        /// <param name="rule">A string representing the <see cref="Rule"/>. It must be a "IF..THEN" statement.
        /// For a more detailed  description see <see cref="Rule"/> class.</param>
        /// 
        /// <param name="normOperator">A class that implements a <see cref="INorm"/> interface to
        /// evaluate the AND operations of the Rule. </param>
        /// 
        /// <param name="coNormOperator">A class that implements a <see cref="ICoNorm"/> interface
        /// to evaluate the OR operations of the Rule. </param>
        /// 
        public Rule( Database fuzzyDatabase, string name, string rule, INorm normOperator, ICoNorm coNormOperator )
        {
            // the list with the RPN expression
            rpnTokenList = new List<object>( );

            // setting attributes
            this.name           = name;
            this.rule           = rule;
            this.database       = fuzzyDatabase;
            this.normOperator   = normOperator;
            this.conormOperator = coNormOperator;
            this.notOperator    = new NotOperator( );

            // parsing the rule to obtain RPN of the expression
            ParseRule( );
        }