AI-FuzzyInference

 view release on metacpan or  search on metacpan

FuzzyInference.pm  view on Meta::CPAN

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    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

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
    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

790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
=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:

README  view on Meta::CPAN

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
        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 )