The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AI::ExpertSystem::Simple::Goal - Utility class for a simple expert system

VERSION

This document refers to verion 1.00 of AI::ExpertSystem::Simple::Goal, released April 25, 2003

SYNOPSIS

This class handles the goal in the expert system and returns the answer when the goal is matched.

DESCRIPTION

Overview

This is a utility class for AI::ExpertSystem::Simple

Constructors and initialisation

new( NAME, MESSAGE )

The constructor takes two arguments. The first, NAME, is the name of the attribute that when set will trigger the end of the consoltation. The second argument, MESSAGE, is the text that will be interpolated as the answer for the consoltation.

Public methods

is_goal( NAME )

This method compares the given NAME with that of the attribute name given when the object was constructed and returns true if they are the same or false if not.

name( )

This method return the value of the NAME argument that was set when the object was constructed.

answer( VALUE )

This method take VALUE to be the value of the goal attribute and will use it to interpolate and return the MESSAGE that was given when the object was constructed.

Private methods

None

ENVIRONMENT

None

DIAGNOSTICS

Goal->new() takes 2 arguments

When the constructor is initialised it requires two arguments. This message is given if more or less arguments were supplied.

Goal->new() argument 1 (NAME) is undefined

The correct number of arguments were supplied to the constructor, however the first argument, NAME, was undefined.

Goal->new() argument 2 (MESSAGE) is undefined

The correct number of arguments were supplied to the constructor, however the second argument, MESSAGE, was undefined.

Goal->is_goal() takes 1 argument

When the method is called it requires one argument. This message is given if more or less arguments were supplied.

Goal->is_goal() argument 1 (NAME) is undefined

The correct number of arguments were supplied with the method call, however the first argument, NAME, was undefined.

Goal->name() takes no arguments

When the method is called it takes no arguments. This message is given if some were supplied.

Goal->answer() takes 1 argument

When the method is called it requires one argument. This message is given if more or less arguments were supplied.

Goal->answer() argument 1 (VALUE) is undefined

The correct number of arguments were supplied with the method call, however the first argument, VALUE, was undefined.

BUGS

None to date

FILES

See Goal.t in the test directory

SEE ALSO

AI::ExpertSystem::Simple - The base class for the expert system shell

AI::ExpertSystem::Simple::Knowledge - A utility class

AI::ExpertSystem::Simple::Rules - A utility class

AUTHORS

Peter Hickman (peterhi@ntlworld.com)

COPYRIGHT

Copyright (c) 2003, Peter Hickman. All rights reserved.

This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.