Author image Christophe IVORRA
and 1 contributors

NAME

Chorus::Expert - A simple skeleton of application using one or more Chorus::Engine objects (inference engines) working together on a common task.

VERSION

Version 1.04

SYNOPSIS

Chorus::Expert does 3 simple things :

  1 - Registers one or more Chorus::Engine objects
  2 - Provides to each of them a shared working area ($SELF->BOARD)
  3 - Enter an infinite loop on each inference engine until one of them declares the system as SOLVED.

   package A;
      
   use Chorus::Engine;
   our $agent = Chorus::Engine->new();
   $agent->addrule(...);

   # --
      
   package B;
   use Chorus::Engine;
   our $agent = Chorus::Engine->new();
   $agent->addrule(...);
   
   # --
     
   use Chorus::Expert;
   use A;
   use B;
   
   my $xprt = Chorus::Expert->new();
   $xprt->register($A::agent);
   $xprt->register($B::agent);
   
   $xprt->process();

SUBROUTINES/METHODS

register

   use Chorus::Expert;
   use Chorus::Engine;
   
   my $xprt = Chorus::Expert->new();

   my $e1 = Chorus::Engine->new();    # inference engine 1
   my $e2 = Chorus::Engine->new();    # inference engine 2

   $xprt->register($e1,$e2);          # $e1 and $2 added to the list of agents
                                      # providing to all of them a shared attribute named BOARD
   

process

   Tells the Chorus::Expert object to enter in an infinite loop until one of the engines 
   set the attribute $SELF->BOARD->{SOLVED} to something true. 
   The Chorus::Expert object will ask its agents, one after one, to test all its rules with all
   possible combinations of its _SCOPE attributes. An agent never ends while at least one of its rules 
   returns a true value in the same loop (see Chorus::Engine documentation).  
   
   $xprt->process();            # without argument
   $xprt->process($something);  # this argument will become $SELF->BOARD->INPUT for all agents
   

AUTHOR

Christophe Ivorra, <ch.ivorra at free.fr>

BUGS

Please report any bugs or feature requests to bug-chorus-expert at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Chorus-Expert. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Chorus::Expert

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 Christophe Ivorra.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.