AI-FuzzyInference
view release on metacpan or search on metacpan
FuzzyInference.pm view on Meta::CPAN
676869707172737475767778798081828384858687
my
$obj
=
bless
{} =>
$class
;
$obj
->_init;
return
$obj
;
}
# sub _init() - private method.
#
# no arguments. Initializes the data structures we will need.
# It also defines the default logic operations we might need.
sub
_init {
my
$self
=
shift
;
$self
->{SET} = new AI::FuzzyInference::Set;
$self
->{INVARS} = {};
$self
->{OUTVARS} = {};
$self
->{RULES} = [];
$self
->{RESULTS} = {};
FuzzyInference.pm view on Meta::CPAN
274275276277278279280281282283284285286287288289290291292293294
my
(
$self
,
$var
,
) =
@_
;
return
undef
unless
exists
$self
->{RESULTS}{
$var
};
return
$self
->{RESULTS}{
$var
};
}
# sub reset() - public method
#
# cleans the data structures used.
sub
reset
{
my
$self
=
shift
;
my
@list
=
$self
->{SET}->listMatching(
q|:implicated$|
);
push
@list
=>
$self
->{SET}->listMatching(
q|:aggregated$|
);
$self
->{SET}->
delete
(
$_
)
for
@list
;
$self
->{RESULTS} = {};
FuzzyInference.pm view on Meta::CPAN
790791792793794795796797798799800801802803804805806807808809810=item value()
This method returns the value of the supplied output variable. It only
works for output variables (defined using the C<outVar()> method),
and only returns useful results after a call to C<compute()> has been
made.
=item reset()
This method resets all the data structures used to compute crisp values
of the output variables. It is implicitly called by the C<compute()>
method above.
=back
=head1 INSTALLATION
It's all in pure Perl. Just place it somewhere and point your @INC to it.
But, if you insist, here's the traditional way:
243244245246247248249250251252253254255256257258259260261262263
out the old computed
values
before
recomputing the new ones. This is
done through a call to the
"reset()"
method below.
value()
This method returns the value of the supplied output variable. It
only works
for
output variables (
defined
using the
"outVar()"
method), and only returns useful results
after
a call to
"compute()"
has
been made.
reset
()
This method resets all the data structures used to compute crisp
values
of the output variables. It is implicitly called by the
"compute()"
method above.
INSTALLATION
It's all in pure Perl. Just place it somewhere and point your
@INC
to
it.
But,
if
you insist, here's the traditional way:
To install this module type the following:
( run in 1.144 second using v1.01-cache-2.11-cpan-49f99fa48dc )