AI-Fuzzy
view release on metacpan or search on metacpan
B<equal>
Returns true if the sets have the same elements and those elements
are all equal.
B<as_string>
Prints the set as tuples:
$b = new AI::Fuzzy::Set( x5 => .3, x6 => .5, x7 => .8, x8 => 0, x9 => 1);
print "b is: " . $b->as_string . "\n";
prints:
b is: x8/0, x5/0.3, x6/0.5, x7/0.8, x9/1
Fuzzy Labels
A Fuzzy::Label label has four attributes: the text of the label (it can
be any scalar, really), and three numbers: low, mid, high if you imagine
a cartesian plane (remember graph paper in algebra?) of all possible
values, the label applies to a particular range. the graph might look
something like this:
|Y * (mid, 1)
| / \
| / \
| / \
| / \
-|-------*-------------*------- X
(low,0) (high,0)
the Y value is applicability of the label for a given X value
the mid number is the "pure" value. eg, orange is at 0 or 360 degrees on
the color wheel. the label applies 100% at the mid point.
the low and high numbers are the two points at which the label ceases to
apply.
note that labels can overlap, and that the mid number isn't always in
the exact center, so the slope of the two sides may vary...
$fl = new AI::FuzzyLabel;
$fl->addlabel( "hot", 77, 80, 100 ); # what I consider hot. :) (in
Farenheit, of course!)
$a = $fl->applicability($label, $value); # $a is now the degree to which
$label applies to $value
$l = $fl->label ($value); # applies a label to $value
@l = $fl->label($value); # returns a list of labels and their
applicability values
$s = new AI::Fuzzy::Set( $fl->label($value) ); # same thing, but now
it's an object
@range = $fl->range(); # returns a list of labels, sorted by their
midpoints # eg: ("cold", "cool", "lukewarm", "warm", "hot")
AUTHOR
Tom Scanlan <tscanlan@openreach.com>, current maintainer
Michal Wallace (sabren@manifestation.com), original author
SEE ALSO
Move along, nothing to "see also" here...
BUGS
Please send any bugs to Tom Scanlan <tscanlan@openreach.com>
( run in 0.835 second using v1.01-cache-2.11-cpan-39bf76dae61 )