The Interval Switching Comparator component compares a numerical property with intervals or values of the same type. This component allows you to compare a numerical property with:
One or several values
One or several intervals
One or several values and one or several intervals
When inserted in the decision tree, the Interval Switching Comparator component creates:
A branch for each interval or value, which is activated if the property matches the related interval or value.
An additional branch that is activated if the property does not match an interval or a value.
|
Note: The test stops when a branch matches the comparison; therefore, the order of intervals and values is important. |
When the component is executed, only one branch is activated depending on the test result.
In a price plan, if you want to apply different prices to branches according to the value of a property, you may need to compare a property with a set of intervals. To use the Interval Switching Comparator inside your price plan, do the following:
After you add the component, choose the property and the limits of the intervals or values.
Describe the pricing of each decision tree branch by using a Function component.
A software editor wants to determine the license price of their chargeable item class according to the number of users, which can vary from 10 users to 50 users. An interval represents a group of 10 users. For more than 50 users, the price is $700. To determine the license price, the software editor needs to create a numerical property called "number of users" and test if the property matches one of the intervals. The following table presents the information that the software editor needs to set up the Interval Switching Comparator component inside the price plan:
|
Data |
Settings |
|
Property |
Number of users |
|
Value “0” |
0 |
|
Interval I1 |
From 0 to 10 users: ]0, 10] |
|
Interval I2 |
From 10 to 20 users: ]10,20] |
|
Interval I3 |
From 20 to 30 users: ]20, 30] |
|
Interval I4 |
From 30 to 40 users: ]30, 40] |
|
Interval I5 |
From 40 to 50 users: ]40,50] |
|
Pricing rules |
Branch value 0: error message. Branch I1: $150. Branch I2: $280. Branch I3: $400. Branch I4: $500. Branch I5: $600. Branch “outside of interval”: $700. |
Name: Type the name of the component (mandatory).
Description: Allows you to type the description of the component (optional).
Property Name: Provides the list of numerical properties. Select the first numerical property.
: Adds a row to the table. Click this button to add an interval or a value to the table.
: Deletes a row from the table. To remove an interval, select the corresponding interval row, and then click this button.
: Moves a row up in the table. To move an interval up, select the corresponding interval row, and then click this button.
: Moves a row down in the table. To move an interval down, select the corresponding interval row, and then click this button.
: Opens the Open dialog box to search for a file and import data into the table. Click this button when you want to create intervals with data from a CSV file instead of manually entering the data.
: Deletes all the rows in the table. Click this button to delete the list of intervals.
Parameters: Allows you to set up each row of the table. Each row represents an interval or a value to be compared with the first numerical property. Each interval row also represents a branch in the decision tree.
One Bound Interval: Click this option to compare the first numerical property with a value instead of an interval, and then type the value or select a property in the Between box.
Between: If the One Bound Interval option is selected, the Between option represents a value to compare with the first numerical property; otherwise, the Between option is the lowest limit of the interval to be compared with the first numerical property. Type a value or select a property to compare with the first numerical property. In the case of an interval, click the Included option to include the limit or clear it to exclude the limit.
And: If the One Bound Interval option is not selected, the And option is the highest limit of the interval to be compared with the first numerical property. Type a value or select a property to compare with the first numerical property. Click the Included option to include the limit or clear it to exclude the limit. This box is not available if you have clicked the One Bound Interval option.