AI-Fuzzy

 view release on metacpan or  search on metacpan

Fuzzy.pm  view on Meta::CPAN

if ( $fl->lessthan($fx) ) {
    print "the laws of nature have changed\n";
}

# there is a lessthan, greaterthan, lessequal, greaterequal, and between 
#  that functions as above or using <,>,<=,>=

$a = $fl->applicability($value);
    # $a is now the degree to which this label applies to $value

=head2 Fuzzy Axis

A Fuzzy::Axis maintains a hash of labels.  Thus you can now look at how
values apply to the full range of labels.  The graph of an Axis might
look like this:


	
	  |Y             * (mid, 1)
	  |           /\/ \      /|
	  |  /- -\   / /\  \    / |  
	  | /     \-/ /  \   \ /  |  (some function on some range of x)
	  | |        /    \   /\  ---*-|
	 -|---------*-----------*------- X
	           (low,0)      (high,0)
         

the Y value is still the applicability of the label for a given X value,
but there are three labels on this Axis.  A different X value may
put your value into a new label.

$fl = new AI::Fuzzy::Axis;

$fl->addlabel($label);
    # add a label created as in AI::Fuzzy::Label docs

$a = $fl->applicability($label, $value);
    # $a is now the degree to which $label applies to $value

$l = $fl->label ("labelname");
    # returns the label object named "labelname"

$l = $fl->labelvalue ($value);
    # applies a label to $value

@l = $fl->labelvalue($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")
=head1 AUTHOR

Tom Scanlan <tscanlan@openreach.com>,
current maintainer 

Michal Wallace  (sabren@manifestation.com),
original author


=head1 SEE ALSO

Move along, nothing to "see also" here...

=head1 BUGS

Please send any bugs to Tom Scanlan <tscanlan@openreach.com>

=cut



( run in 0.952 second using v1.01-cache-2.11-cpan-140bd7fdf52 )