Chorus::Expert - A simple skeleton of application using one or more Chorus::Engine objects (inference engines) working together on a common task.
Version 1.04
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();
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
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
Christophe Ivorra, <ch.ivorra at free.fr>
<ch.ivorra at free.fr>
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.
bug-chorus-expert at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Chorus::Expert
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Chorus-Expert
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Chorus-Expert
CPAN Ratings
http://cpanratings.perl.org/d/Chorus-Expert
Search CPAN
http://search.cpan.org/dist/Chorus-Expert/
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.
To install Chorus::Engine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chorus::Engine
CPAN shell
perl -MCPAN -e shell install Chorus::Engine
For more information on module installation, please visit the detailed CPAN module installation guide.