AForge.Fuzzy.Rulebase.AddRule C# (CSharp) Method

AddRule() public method

Adds a fuzzy rule to the database.
The fuzzy rule was not initialized. The fuzzy rule name already exists in the rulebase.
public AddRule ( AForge.Fuzzy.Rule rule ) : void
rule AForge.Fuzzy.Rule A fuzzy to add to the database.
return void
        public void AddRule( Rule rule )
        {
            // checking for existing name
            if ( this.rules.ContainsKey( rule.Name ) )
                throw new ArgumentException( "The fuzzy rule name already exists in the rulebase." );
            
            // adding rule
            this.rules.Add( rule.Name, rule );
        }