Interval Switching Comparator

Note: You can use this component in a price plan, in a pricing macro, in a charging plan, or in a refill plan (refill logic).

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:

When inserted in the decision tree, the Interval Switching Comparator component creates:

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.

Use

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:

  1. After you add the component, choose the property and the limits of the intervals or values.

  2. Describe the pricing of each decision tree branch by using a Function component.

Example

A software editor wants to determine the license price of their chargeable item package 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.

Identification area

Name: Type the name of the component (mandatory).

Description: Allows you to type the description of the component (optional).

Definition tab

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.