Rate routine steps
Each rate routine has one or more instructions that define the rating algorithm. Each instruction is composed of one or more steps. Each step has the following fields:
- Instruction – This field is the target of an assignment operator, a conditional instruction, or the start of a section comment. Blank for other operators. The instruction field types can be properties on the cost, parameters including rate modifiers, variables, and conditionals. This instruction field is not the same as an instruction, which is composed of one or more steps.
- Operator – An assignment, arithmetic, or rounding operator. Blank for conditional instructions.
- Opening parentheses (optional) – One or more opening parentheses to group a series of steps.
- Operand – The operand of the current step. Operands types can be properties on the cost, functions, parameters, rate tables, variables, conditional expressions, constants, date constants, typelist values, and scale for rounding operators.
- Closing parentheses (optional) – One or more closing parentheses to group a series of steps.
- Line comment– Optional description of the step.
For example, you can represent a rate routine that calculates the coverage premium for personal auto. In the following table, each row corresponds to a step:
# |
Instruction |
Op |
( |
Operand |
) |
Line comment |
|---|---|---|---|---|---|---|
1 |
-- |
Base Rate and Adjusted Rate Calculation |
||||
2 |
BaseRate |
← |
table:Base Rate |
The instruction field is the BaseRate field on a cost. The ← operator assigns the operand to the BaseRate in the instruction field. |
||
3 |
R |
.001 |
Round Base Rate to thousandths (Round Half Up) |
|||
4 |
vehicleTypeFactor |
← |
table:Vehicle Type Factor |
|||
5 |
vehicleCostFactor |
← |
table:Vehicle Cost Factor |
|||
6 |
AdjustedRate |
← |
BaseRate |
Determine adjusted rate. The instruction field and operand are properties on the cost. |
||
7 |
X |
table:Coverage Factor |
Operand is a rate table. |
|||
8 |
X |
table:UW Co Factor |
Operand is a rate table. |
|||
9 |
X |
Policy Line.PAMultiCarDiscount |
Operand is a parameter. |
|||
10 |
X |
min(vehicleCostFactor, vehicleTypeFactor) |
Operand is a function. |
|||
11 |
||||||
12 |
-- |
Term Amount Determination |
||||
13 |
IF |
AdjustedRate < table:Min Premium AND Vehicle.VehicleType = VehicleType.Other |
The instruction field begins a conditional instruction, and operand is a conditional expression. |
|||
14 |
TermAmount |
← |
table:Min Premium |
The instruction field is the TermAmount field on a cost, and operand is a rate table. |
||
15 |
RU |
10 |
Round up minimum premium to tens. |
|||
16 |
ELSE |
Continue the conditional instruction begun in step 13. |
||||
17 |
TermAmount |
← |
AdjustedRate |
Use system default rounding. |
||
18 |
ENDIF |
End of the conditional instruction begun in step 13. |
||||
In the rate routine, steps 2 and 3 make up one instruction. Steps 4 and 5 are each a single line instruction. Steps 6 through 10 are one instruction. Steps 13 through 18 are a conditional instruction.
Steps 1 and 12 are section comments that span the whole step.
