Skip to main content
Install Relativities before starting. The installation includes the rslc compiler. To understand the syntax first, read RSL at a glance.

The rating plan

This example uses these rules:
  • Multiply Coverage A, in thousands of dollars, by a rate for each peril.
  • Choose rates from the dwelling’s protection class.
  • Add 1.5% of each scheduled item’s value.
  • Add a $35 policy fee.
  • Round the total premium to whole dollars, half up.
A $250,000 dwelling in protection class 5, with scheduled items worth $1,200 and $800, produces a $1,028 premium. The rates, rules, and source citations are synthetic.

Create the files

Create a folder for the rater and its rate table:
Your files have this layout:

Rating algorithm

Save the following source as rater.rsl in the dwelling/ folder.
dwelling/rater.rsl
The source defines the policy’s inputs, reads the rate table, calculates premiums, and publishes the final premium outcome. base_rate gives the table lookup a name, so peril_premium is arithmetic over named values. artifact(...) identifies a source document in Effective by its artifact ID. This tutorial uses a placeholder ID for its synthetic manual. Citations such as manual:p3 refer to pages in that document.

Rate table

Save this table as tables/BaseRate.csv in the same folder:
dwelling/tables/BaseRate.csv
Each row starts a protection-class band: 1–3, 4–6, 7–9, or 10 and above.

Check and package the rater

Run the compiler check:
The check validates the implemented algorithm. Source review and independent rating examples establish whether a rater follows its filing. Package the rater into a bundle:
The bundle contains the source, rate tables, and generated files needed to load the rater.

Rate a policy

From the same dwelling/ folder, load the bundle and supply the policy facts:
The premium is $1,028:
While you edit a rater, Rater.build compiles it straight from the source file and skips the export:
Rater.build takes the .rsl file, or the folder that holds it. A source that fails to compile raises BundleError, and rslc check prints each message. The bundle from rslc export, loaded with Rater.load, is the packaged route: one file to keep and share.

Test an input rule

Submit a protection class outside the accepted range:
The rater returns the rule’s code, the input that broke the rule, and the rule’s message. For a rule on an input, reason holds the input’s path, then the message. For a rule on a record, reason holds the record’s path, then the message, and the message alone for the root record Policy. Refusals explains how to inspect the rule’s source citation.

Next step

Read RSL at a glance to understand the language used in this example.