Fuzzy markup language: Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
m Add: isbn, doi, volume. Removed accessdate with no specified URL. Removed parameters. You can use this bot yourself. Report bugs here. | User-activated.
m FML Syntax: Replace "let us consider" statements per MOS:NOTED and consensus at Wikipedia talk:Manual of Style#"Let us consider" statements, replaced: let us consider → consider (3)
Line 66:
Every shaping tag uses a set of attributes which defines the real outline of corresponding fuzzy set. The number of these attributes depends on the chosen fuzzy set shape.
 
In order to make an example, let us consider the ''Tipper Inference System'' described in Mathwork Matlab Fuzzy Logic Toolbox Tutorial. This Mamdani system is used to regulate the tipping in, for example, a restaurant. It has got two variables in input (''food'' and ''service'') and one in output (''tip''). FML code for modeling part of knowledge base of this fuzzy system containing variables ''food'' and ''tip'' is shown below.
 
<source lang="xml">
Line 101:
As for rule base component, FML allows to define a set of rule bases, each one of them describes a different behavior of system. The root of each rule base is modeled by <code><RuleBase></code> tag which defines a fuzzy rule set. The <code><RuleBase></code> tag uses five attributes: ''name'', ''type'', ''activationMethod'', ''andMethod'' and ''orMethod''. Obviously, the ''name'' attribute uniquely identifies the rule base. The ''type'' attribute permits to specify the kind of fuzzy controller (Mamdani or TSK) respect to the rule base at issue. The ''activationMethod'' attribute defines the method used to implication process; the ''andMethod'' and ''orMethod'' attribute define, respectively, the ''and'' and ''or'' algorithm to use by default. In order to define the single rule the <code><Rule></code> tag is used. The attributes used by the <code><Rule></code> tag are: ''name'', ''connector'', ''operator'' and ''weight''. The ''name'' attribute permits to identify the rule; ''connector'' is used to define the logical operator used to connect the different clauses in antecedent part (and/or); ''operator'' defines the algorithm to use for chosen connector; ''weight'' defines the importance of rule during inference engine step. The definition of antecedent and consequent rule part is obtained by using <code><Antecedent></code> and <code><Consequent></code> tags. <code><Clause></code> tag is used to model the fuzzy clauses in antecedent and consequent part. This tag use the attribute ''modifier'' to describe a modification to term used in the clause. The possible values for this attribute are: ''above'', ''below'', ''extremely'', ''intensify'', ''more or less'', ''norm'', ''not'', ''plus'', ''slightly'', ''somewhat'', ''very'', ''none''. To complete the definition of fuzzy clause the nested <code><Variable></code> and <code><Term></code> tags have to be used. A sequence of <code><Rule></code> tags realizes a fuzzy rule base.
 
As example, let us consider a Mamdani rule composed by ''(food is rancid) OR (service is very poor)'' as antecedent and ''tip is cheap'' as consequent. The antecedent part is formed by two clauses: ''(food is rancid)'' and ''(service is poor)''. The first antecedent clause uses ''food'' as variable and ''rancid'' as fuzzy term, whereas, the second antecedent clause uses ''service'' as a variable, ''poor'' as fuzzy term and ''very'' as modifier; the consequent clause uses ''tip'' as a fuzzy variable and ''cheap'' as a fuzzy term. The complete rule is:
 
'''IF''' ''(food is rancid)'' '''OR''' ''(service is very poor)'' '''THEN''' ''(tip is cheap)''.
Line 160:
The FML definition of rule base component in a Tsk system doesn’t change a lot. The only different thing is that the <code><Clause></code> tag doesn’t have the modifier attribute.
 
As example, let us consider a tsk rule composed by ''(food is rancid) OR (service is very poor)'' as antecedent and, as consequent, ''tip=1.9+5.6*food+6.0*service'' that can be written as ''tip is cheap'' in an implicitly way. So the rule can be written in this way:
'''IF''' ''(food is rancid)'' '''OR''' ''(service is very poor)'' '''THEN''' ''(tip is cheap)''.