These codes are made by policy based programming. You can find the Policy –> RuleSet –> Rule to do some kinds of works. So, I named it as PolicyEngine. Add the comparators, rules, and collected these rules into rulesets. Finally, run it in an engine with many policies. If there is any problem, please contact me. I will answer it for you. Thank you.