Show/Hide Toolbars

CWT Software Configuration Handbook

Navigation: Appendices > Tariff calculation

Tariff Introduction

Scroll Prev Top Next More

You use tariff packages to specify the price of articles, e.g., parking time. The number of packages that can be used are only restricted by the available memory capacity on the SD card.

A tariff package consists of a number of package related rules and up to 32 tariff intervals.

The tariff intervals usually contain a time predicate and a tariff rate. Sometimes also information that the interval is blocked. The time predicate defines the period when the tariff rate is valid.

CWTSOF~1_img62

Example:

Let us say you want to specify that the price is $1 per hour weekdays during daytime and that the rest of the time is free.

Then you could define a tariff package that includes the time Interval Monday–Friday 08:00 AM–06:00 PM. We name the package “Downtown winter rates”. Here is what the package definition would look like:

<TARIFFPACKAGE Name = "Downtown winter rates">
<tariff>
   PACKAGE "Downtown winter rates";
 
   //Mon to Fri 0800 to 1800 ==> $1 per hour
   INTERVAL "Weekdays day time";
   timepredicate = "((($weekday in [mon to fri]) and ($hour in [08 to 18[)))";
   tariffrate = linear 1 per 60;
 
   //Mon to Fri 0000 to 0800 and 1800 to 0000 ==> free
   INTERVAL "Free time";
   timepredicate = "((($hour in [00 to 08])or ($hour in [18 to 00])))";
   tariffrate = flat 0 until end of interval;
</tariff>
</TARIFFPACKAGE>

The Example: above contains the two tariff intervals “Weekdays day time” and “Free time”.

If no time predicate is specified the interval will always be the current time, that is, the tariff rate is always used unless overridden by some other rule.

For time predicates, there is a set of time functions. The function names always start with the dollar symbol “$”. Two of them are $weekday (current weekday) and $hour (the current hour of the day).

Weekdays can be specified by using the following constants:  mon, tue, wed, thurs, fri, sat and sun.

You can specify a time or date range by using square brackets [ ]. To define the range Monday to Wednesday, write [mon to wed] or [mon - wed].

To specify that the time between 18:00 and 07:59 is free, use a square bracket turned the other way around [08 to 18[.

There are three types of tariff rates:

Linear rate using minute precision, for Example: 1€ per 60 minutes. This is the type used in the Example: above.

Unit rate, for Example: 5€ for 1 hour, 7€ for 2 hours

Flat rate, for Example: 10–18: 10€.