describe-ksAgenda Control Shellexecuted-ksas-ofensure-ksGoTo Top

ensure-ks   ks-name &key activation-predicate enabled execution-function ks-class ksa-class obviation-events obviation-predicate precondition-function rating retrigger-events retrigger-function revalidation-predicate trigger-events => ks[Function]

Purpose
Programmatically define or redefine a knowledge source (KS).

Package   :agenda-shell

Module   :agenda-shell

Arguments and values

ks-name     A symbol naming the KS
activation-predicate     A function designator specifying a function object of two arguments (the KS unit instance and the event object) that returns a generalized boolean or nil (default is nil)
enabled     A generalized boolean (default is t)
execution-function     A function designator specifying a function object of one argument (the KSA unit instance) or nil (default is nil)
ks-class     A class or a symbol specifying a class
ksa-class     A class or a symbol specifying a class
obviation-events     An event-specification (see below)
obviation-predicate     A function designator specifying a function object of two arguments (the KSA unit instance and the event object) that returns a generalized boolean or nil (default is nil)
precondition-function     A function designator specifying a function object of two arguments (the KS unit instance and the event object) or nil (default is nil)
rating     A rating (default is 1)
retrigger-events     An event-specification (see below)
retrigger-function     A function designator specifying a function object of two arguments (the KSA unit instance and the event object) or nil (default is nil)
revalidation-predicate     A function designator specifying a function object of one argument (the KSA unit instance) that returns a generalized boolean or nil (default is nil)
trigger-events     An event-specification (see below)
ks     A KS

Returns
The unit instance representing the KS

Detailed syntax

event-specification ::= (event-signature*)

event-signature ::= (event-class-specifier
    [unit-class-or-instance-specifier
        [{:slot-name slot-name} | {:slot-names slot-names} |
          {:path path} | {:paths paths}]])

event-class-specifier ::= atomic-event-class | (atomic-event-class subeventing-specifier) | t
atomic-event-class ::= event-class | event-class-name
subeventing-specifier ::= :plus-subevents | :no-subevents + | =

The shorthand + subevents specifier is equivalent to :plus-subevents and = to :no-subevents.

unit-class-or-instance-specifier ::= unit-instance | (unit-instance*) |
atomic-unit-class |
(atomic-unit-class subclassing-specifier) | t
atomic-unit-class ::= unit-class | unit-class-name
subclassing-specifier ::= :plus-subclasses | :no-subclasses | + | =

The shorthand + subclasses specifier is equivalent to :plus-subclasses and = to :no-subclasses.

Description
This function is called to define or redefine a KS. It is the functional equivalent of define-ks and is called by the expansion of the define-ks macro. (See the description of define-ks for details of KS definition and redefinition.)

See also
    define-ks
    ks
    ks-enabled-p
    undefine-ks

Example
Define an initial KS that is triggered when the control shell is started:

  (ensure-ks 'initial
     :trigger-events '((control-shell-started-event)) 
     :execution-function #'initial-ks-function)


The GBBopen Project


describe-ksAgenda Control Shellexecuted-ksas-ofensure-ksGoTo Top