Structural – Based on
When making decisions, people generally take multiple factors into account.
A prospective house buyer might consider the location of the house, the price of the house, how many bedrooms a property has, and any number of other factors, before making an offer. A sales representative would consider the potential value of a client, the relationship with a client, what a client wants to deliver, etc when deciding how hot a sales lead is. This way of thinking can be replicated in Rainbird by using ‘based on’ rules.
Rainbird is able to make decisions by considering multiple different factors before reaching a result. A ‘based on’ rule is a rule that considers one factor, and will generally produce a result based on that one factor. Multiple ‘based on’ rules can be brought together into one ‘overall’ rule.
‘Based on’ rules are one of the most commonly used types of rules and can be applied pretty much anywhere Rainbird has to make a decision considering different factors, from simple recommendation tools to more complex qualification tools.
Figure 1: The based on colour rule TriangleLet’s build a model that will use ‘based on’ rules to recommend a car to a user. The first factor we’ll build a ‘based on’ rule for is car colour. ‘Colour’ and ‘car’ concept instance have been created, and facts have been created on the ‘is in colour’ relationship:
Figure 2: The based on colour rule TriangleWhen running a query on the ‘based on colour’ relationship, Rainbird will ask the user what colour car they want and recommend cars purely based on the colour the user chooses: Someone in the market for a new car is unlikely to buy a car based purely on colour. They might also consider the type of engine a car has. We’ve added a new concept, ‘Engine’, to the model, and created some new relationships between ‘Car’ and ‘Engine’ (questions set to off), ‘Person’ and ‘Engine’ (questions set to second form object), and a new relationship between ‘Person’ and ‘Car’ called ‘based on engine type’. Questions for the relationship between On the ‘based on engine type’ is another ‘triangle rule’:
Figure 3: Additional Base on rule for Engine TypeWhen running the ‘based on engine type’ relationship, Rainbird will recommend a car based on the engine type the user wants:
Figure 4: Creating the overall ruleWhen querying the ‘overall’ relationship, Rainbird will now only recommend a car if the car is both in the colour the user wants, and has the type of engine the user wants:
Both of the conditions in the ‘overall’ relationship are set to ‘Mandatory’, so Rainbird will only return a result if both of the conditions are met. If the conditions are set to optional, or a mixture of mandatory and optional, Rainbird will recommend cars that don’t quite match the user’s requirements at a lower certainty factor. The clip below demonstrates how the results will change, depending on whether the conditions are mandatory or optional:
Different weightings can be set if some factors are more important than others:
Using the same basic triangle structure, more ‘based on’ rules can be built and added to the ‘overall’ relationship:
Figure 5: Replacing Based on rules in the overall ruleMore information on weighting can be found in the Weight Article.
Query & Results
Run the overall rule to see the result for all based on rules combined.
- Make sure to switch off questions on the ‘based on’ relationships
- If you’re finding Rainbird cannot produce an answer when running an ‘overall’ query, try setting some of the conditions to ‘optional’ or reducing the minimum rule certainty
- Setting the rules to ‘optional’ will also help you troubleshoot your ‘overall’ relationship as the evidence tree will show you which conditions of the ‘overall’ relationship have not been satisfied
The RBLang below will generate the example map used in the ‘subject’ section of the article. Click on ‘Export .rbird’ to download the knowledge map, or ‘copy RBLang’ and paste the code directly into Rainbird.
Version 1.02 – Last Update: 19/02/2021