Closed Rezenders closed 1 year ago
Added constrainment-operator
to constrainment
constrainment-operator sub attribute,
value string,
regex "^(<|<=|>|>=)";
Added condition in the constrainment-status
rule to check which operator should be used. If no operator is defined, >=
is used as default.
rule constrainment-status-violated:
when{
$constrainment (constraint: $constraint) isa constrainment, has attribute-value $value;
$constraint has attribute-measurement $measurement;
{
{
$constrainment has constrainment-operator ">=";
} or {
not {$constrainment has constrainment-operator $op;};
};
not {
$measurement >= $value;
};
} or {
$constrainment has constrainment-operator ">";
not {
$measurement > $value;
};
} or {
$constrainment has constrainment-operator "<=";
not {
$measurement <= $value;
};
} or {
$constrainment has constrainment-operator "<";
not {
$measurement < $value;
};
};
} then {
$constrainment has constrainment-status 'violated';
};
Done at: 32f50d9
Related to: https://github.com/meta-control/mc_mdl_tomasys/issues/9