Chorus
view release on metacpan or search on metacpan
examples/diagnosis.pl view on Meta::CPAN
Derived slots (set by the pipeline)
------------------------------------
fever_grade : 'none' | 'low' | 'high' (computed from temperature)
hypothesis : the current diagnostic hypothesis
confidence : 0..1
Mechanisms illustrated:
_NEEDED (2 levels) temperature â infer from skin_temp (backward chaining).
fever_grade â infer from temperature (second _NEEDED level).
_LOCK_UNTIL_STABLE Agent 2 (Diagnose) is blocked while Agent 1 (Collect)
is still making progress.
replay_all() When Diagnose finds a hypothesis that unlocks new
symptom checks, it calls replay_all() so Collect
can complete the missing slots before Diagnose
re-evaluates.
solved() Called when confidence > 0.8.
=cut
use FindBin qw($Bin);
lib/Chorus/Expert.pm view on Meta::CPAN
=head2 _LOCK_UNTIL_STABLE
An optional flag set directly on an agent frame:
$agent->{_LOCK_UNTIL_STABLE} = 'Y';
When C<_LOCK_UNTIL_STABLE> is set on agent N, C<process()> skips that agent in
the current iteration if B<any> earlier agent has already succeeded
(C<_SUCCES> is true on that agent). This implements priority-based sequencing:
earlier agents are given another full pass before the locked agent is allowed
to run.
Typical use: a "global cleanup" or "conformity check" agent that should only
run once all upstream agents have stabilised for the current cycle.
=head2 _REPLAY and _REPLAY_ALL
These flags are set by the corresponding engine methods and are handled
transparently by C<process()>.
( run in 1.412 second using v1.01-cache-2.11-cpan-800906f7e73 )