The Threshold class is a RuleBlock Activation method that activates the rules whose activation degrees satisfy the equation given by the comparison operator and the threshold, and deactivates the rules which do not satisfy the equation. More...
#include <Threshold.h>
Public Types | |
enum | Comparison { LessThan, LessThanOrEqualTo, EqualTo, NotEqualTo, GreaterThanOrEqualTo, GreaterThan } |
Comparison is an enumerator that provides six comparison operators between the activation degree \(a\) and the threshold \(\theta\). More... | |
Public Member Functions | |
Threshold (Comparison comparison=GreaterThanOrEqualTo, scalar threshold=0.0) | |
Threshold (const std::string &comparison, scalar threshold) | |
virtual | ~Threshold () |
virtual std::string | className () const FL_IOVERRIDE |
Returns the name of the activation method, which is also utilized to register the activation method in the ActivationFactory. More... | |
virtual std::string | parameters () const FL_IOVERRIDE |
Returns the comparison operator followed by the threshold. More... | |
virtual void | configure (const std::string ¶meters) FL_IOVERRIDE |
Configures the activation method with the comparison operator and the threshold. More... | |
virtual void | setComparison (Comparison comparison) |
Sets the comparison operator for the activation method. More... | |
virtual Comparison | getComparison () const |
Gets the comparison operator for the activation method. More... | |
virtual std::string | comparisonOperator () const |
Returns the comparison operator of the activation method. More... | |
virtual std::string | comparisonOperator (Comparison comparison) const |
Returns the given comparison operator of the activation method. More... | |
virtual std::vector< std::string > | availableComparisonOperators () const |
Returns the list of available comparison operators of the activation method. More... | |
virtual Comparison | parseComparison (const std::string &comparisonOperator) const |
Parses the comparison operator, or throws an exception if the parameter does not correspond to a valid operator. More... | |
virtual void | setValue (scalar value) |
Sets the threshold value of the activation method. More... | |
virtual scalar | getValue () const |
Gets the threshold value of the activation method. More... | |
virtual void | setThreshold (Comparison comparison, scalar value) |
Sets the comparison operator and the threshold for the activation method. More... | |
virtual void | setThreshold (const std::string &comparison, scalar value) |
Sets the comparison operator and the threshold for the activation method. More... | |
virtual bool | activatesWith (scalar activationDegree) const |
Returns whether the activation method will activate a rule with the given activation degree. More... | |
virtual Complexity | complexity (const RuleBlock *ruleBlock) const FL_IOVERRIDE |
Computes the estimated complexity of activating the given rule block. More... | |
virtual void | activate (RuleBlock *ruleBlock) FL_IOVERRIDE |
Activates the rules whose activation degrees satisfy the comparison equation with the given threshold, and deactivate the rules which do not. More... | |
virtual Threshold * | clone () const FL_IOVERRIDE |
Clones the activation method. More... | |
Public Member Functions inherited from fl::Activation | |
Activation () | |
virtual | ~Activation () |
Static Public Member Functions | |
static Activation * | constructor () |
The Threshold class is a RuleBlock Activation method that activates the rules whose activation degrees satisfy the equation given by the comparison operator and the threshold, and deactivates the rules which do not satisfy the equation.
Definition at line 41 of file Threshold.h.
Comparison is an enumerator that provides six comparison operators between the activation degree \(a\) and the threshold \(\theta\).
Enumerator | |
---|---|
LessThan | \(a < \theta\) |
LessThanOrEqualTo | \(a \leq \theta\) |
EqualTo | \(a = \theta\) |
NotEqualTo | \(a \neq \theta\) |
GreaterThanOrEqualTo | \(a \geq \theta\) |
GreaterThan | \(a > \theta\) |
Definition at line 48 of file Threshold.h.
|
explicit |
|
explicit |
|
virtual |
|
virtual |
Activates the rules whose activation degrees satisfy the comparison equation with the given threshold, and deactivate the rules which do not.
ruleBlock | is the rule block to activate |
Implements fl::Activation.
|
virtual |
Returns whether the activation method will activate a rule with the given activation degree.
activationDegree | an activation degree |
|
virtual |
Returns the list of available comparison operators of the activation method.
==
, !=
, <
, >
, <=
, >=
)
|
virtual |
Returns the name of the activation method, which is also utilized to register the activation method in the ActivationFactory.
Implements fl::Activation.
|
virtual |
|
virtual |
Returns the comparison operator of the activation method.
==
, !=
, <
, >
, <=
, >=
)
|
virtual |
Returns the given comparison operator of the activation method.
comparison | is a valid enum value |
fl::Exception | if the given comparison operator is not valid |
|
virtual |
Computes the estimated complexity of activating the given rule block.
Implements fl::Activation.
|
virtual |
Configures the activation method with the comparison operator and the threshold.
parameters | is the comparison operator and threshold |
Implements fl::Activation.
|
static |
|
virtual |
Gets the comparison operator for the activation method.
|
virtual |
Gets the threshold value of the activation method.
|
virtual |
Returns the comparison operator followed by the threshold.
Implements fl::Activation.
|
virtual |
Parses the comparison operator, or throws an exception if the parameter does not correspond to a valid operator.
comparisonOperator | is an operator in (== , != , < , > , <= , >= ) |
|
virtual |
Sets the comparison operator for the activation method.
comparison | is the operator for the activation method |
|
virtual |
Sets the comparison operator and the threshold for the activation method.
comparison | is the comparison enumerator |
value | is the threshold of the activation method |
|
virtual |
Sets the comparison operator and the threshold for the activation method.
comparison | is a valid comparison operator |
value | is the threshold for activation degrees |
fl::Exception | if the comparison operator is not valid |
|
virtual |
Sets the threshold value of the activation method.
value | is the threshold value for activation degrees |