AI-FuzzyInference

 view release on metacpan or  search on metacpan

FuzzyInference.pm  view on Meta::CPAN


    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

    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


=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

        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 0.242 second using v1.01-cache-2.11-cpan-ba35b6b0368 )