Preference Rule
The preference rule encourages the constraint solver to satisfy the condition, but
doesn't enforce it if the condition can't be met.
The system tries to satisfy the condition in a preference rule, but if for some reason it can't, the system delivers a failure message to the user with Info severity.
The preference rule has this syntax.
1preference(logic expression, string literal | string variable, argument, .., argument);
2preference(logic expression, string literal | string variable);
3preference(logic expression);A preference rule can include an optional explanation message for failure. The message is of Info severity, meaning it does not block the user from continuing with the action.
In this example, the preference rule encourages the user to mention the dBMax value as 90 and the requiredKW value as 500.
1type GeneratorSet {
2 int requiredKW = [101..10000];
3 int dBMax = [0..140];
4 preference(dBMax == 90, "90 preferred for dbMax");
5 preference(requiredKW == 500,"50 preferred for requiredKW");
6}