VS::RuleEngine::Rule::InputOverThreshold - Generic rule for checking input thresholds
use VS::RuleEngine::Declare; my $engine = engine { rule 'valid_name' => instanceof "VS::RuleEngine::Rule::InputOverThreshold" => with_args { 'input_1' => 5, 'input_2' => -5, } }
This is a generic rule that checks if the value from an input is equal or passes a threshold relative to 0. This can be used to model change matrices where a row represets a rule.
The following table shows the conditions when it matches
Input | Threshold | Result ------+-----------+------- x | 0 | match >= y | y > 0 | match >= y | y < 0 | no match <= y | y < 0 | match <= y | y > 0 | no match
This rule expects a hash reference as its argument, which is what with_args provides, where the key is the name of an input and the value is the expected threshold value.
with_args
To install VS::RuleEngine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VS::RuleEngine
CPAN shell
perl -MCPAN -e shell install VS::RuleEngine
For more information on module installation, please visit the detailed CPAN module installation guide.