Skip to content

First

First

Bases: Activation

Activate the first \(n\) rules (in insertion order) whose activation degrees are greater than or equal to the threshold.

related

Attributes

rules instance-attribute

rules = rules

threshold instance-attribute

threshold = threshold

Functions

__init__

__init__(rules: int = 1, threshold: float = 0.0) -> None

Constructor.

Parameters:

Name Type Description Default
rules int

maximum number of rules to activate

1
threshold float

minimum activation degree required to activate the rule.

0.0

activate

activate(rule_block: RuleBlock) -> None

Activate the first \(n\) rules (in insertion order) whose activation degrees are greater than or equal to the threshold.

Parameters:

Name Type Description Default
rule_block RuleBlock

rule block to activate.

required

configure

configure(parameters: str) -> None

Configure the activation method with the parameters.

Parameters:

Name Type Description Default
parameters str

number of rules and threshold (eg, 3 0.5).

required

parameters

parameters() -> str

Return the number of rules and threshold.

Returns:

Type Description
str

number of rules and threshold.