Ejemplo n.º 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( );
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new Fuzzy <see cref="InferenceSystem"/>.
        /// </summary>
        ///
        /// <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(DefuzzificationMethod defuzzificationMethod, INorm normOperator, ICoNorm conormOperator)
        {
            this.defuzzificationMethod = defuzzificationMethod;
            this.normOperator          = normOperator;
            this.conormOperator        = conormOperator;

            this.database        = new Database();
            this.rulebase        = new Rulebase();
            this.inputVariables  = new HashSet <string>();
            this.outputVariables = new HashSet <string>();
        }
        /// <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( );
        }
Ejemplo n.º 4
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( );
 }
Ejemplo n.º 5
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( );
        }