AI-ExpertSystem-Simple
view release on metacpan or search on metacpan
lib/AI/ExpertSystem/Simple/Rule.pm view on Meta::CPAN
return @list;
}
1;
=head1 NAME
AI::ExpertSystem::Simple::Rule - A utility class for a simple expert system
=head1 VERSION
This document refers to verion 1.2 of AI::ExpertSystem::Simple::Rule, released June 10, 2003
=head1 SYNOPSIS
This is a utility class for AI::ExpertSystem::Simple
=head1 DESCRIPTION
=head2 Overview
This class handles the rules
=head2 Constructors and initialisation
=over 4
=item new( NAME )
The constructor takes one argument, the NAME of the rule. The consition and actions are added later.
=back
=head2 Public methods
=over 4
=item reset( )
Resets the state of the rule back to active and all the condition attributes to untested.
=item add_condition( NAME, VALUE )
This adds a condition attribute name / value pair.
=item add_action( NAME, VALUE )
This adds an action attribute name / value pair.
=item name( )
Returns the name of the rule.
=item state( )
Returns the current state of the rule.
=item given( NAME, VALUE )
The NAME / VALUE attribute pair is checked against the rule's conditions to see if a condition is met and the state of the rule
is changed in light of the result.
=item actions( )
Returns a list of the actions set in the rule.
=item conditions( )
Returns a list of the conditions matched in the rule.
=item unresolved( )
Returns a list of all the unresolved condition of the rule.
=back
=head2 Private methods
None
=head1 ENVIRONMENT
None
=head1 DIAGNOSTICS
=over 4
=item Rule->new() takes 1 argument
When the constructor is initialised it requires one argument. This message is given if more or less arguments were supplied.
=item Rule->new() argument 1 (NAME) is undefined
The corrct number of arguments were supplied to the constructor, however the first argument, NAME, was undefined.
=item Rule->reset() takes no arguments
When the method is called it requires no arguments. This message is given if more or less arguments were supplied.
=item Rule->add_condition() takes 2 arguments
When the method is called it requires two arguments. This message is given if more or less arguments were supplied.
=item Rule->add_condition() argument 1 (NAME) is undefined
The corrct number of arguments were supplied with the method call, however the first argument, NAME, was undefined.
=item Rule->add_condition() argument 2 (VALUE) is undefined
The corrct number of arguments were supplied with the method call, however the second argument, VALUE, was undefined.
=item Rule->add_condition() has already been set
This method has already been called and the value set. It cannot be called twice.
=item Rule->add_action() takes 2 arguments
When the method is called it requires two arguments. This message is given if more or less arguments were supplied.
=item Rule->add_action() argument 1 (NAME) is undefined
( run in 1.025 second using v1.01-cache-2.11-cpan-39bf76dae61 )