Decision Tree Evaluator
Taxi & Private Hire › Products › DecisionTree › Decision Tree Evaluator
Generally available
Configurable rules engine: tenant-defined JSON decision trees evaluate against runtime context to produce yes/no or routing decisions. Used by queue eligibility, dispatch policies, tariff selection, modifier matching, webhook filtering, permission profiles — anywhere operators need to express "this applies when X" without code. Tree shapes are boolean-tree (AND / OR / NOT) over typed leaves; leaves are routed to per-domain evaluator services via a tagged service locator.
A rule is built from conditions
The smallest piece is a single condition. Every condition reads the same way — a thing to check, how to compare it, and what to compare it against:
Conditions combine into groups: ALL or ANY
Real rules need more than one condition. You collect them into a group, and the group decides how they combine — either every condition must be true, or any one of them is enough.
Groups can nest — a worked example
Because a group can contain other groups, you can express genuinely intricate policy in plain terms. Here is a tariff called “Complex Account”. Read it top-down: the blue ALL bars mean “every part must hold”, the cyan ANY bar means “one of these is enough”.
In words: price with this tariff when the brand is Go Cabs and the account is Meridian Bank (or any account tagged “Financial”) and the pickup is scheduled Monday–Friday, 09:00–17:00.
How a rule is checked
When something happens — a trip is booked, an event fires — the platform takes its details and walks the rule from the top. Each condition reads a value off the thing being checked, the groups combine the results, and the rule resolves to a yes or no (or, for selection rules like tariffs, picks the first match).
One engine, used everywhere
The power of the decision tree is that it’s the same builder everywhere. The conditions available change to suit what’s being decided, but the way you build a rule never does — the exact menus per use are in the catalogue below.
The catalogue
The diagrams show the idea. The tables below are the exact catalogue — the consumers, conditions, operators and value types, emitted straight from the platform so they always match what the engine actually supports.
Consumers and their condition menus
Each place the engine is used exposes its own menu of conditions and its own matching rule — here is exactly what each one offers.
Each modifier group is evaluated in order; every modifier whose rule matches is added to the price chain. A modifier with no rule is skipped.
Candidate tariffs are filtered by vehicle type, then the first whose rule matches prices the trip; a tariff with no rule is the catch-all default.
Every model whose rule matches is collected and the highest-priority one wins; a model with no rule is a catch-all.
Chooses a fallback dispatch plan for a zone when supply is short.
Intended to decide which trips may enter a dispatch queue.
A gate: the request is allowed only when the rule matches; a profile with no rule denies access.
Evaluated per trip segment to categorise the trip; profiles apply in priority order and one with no rule matches everything. A profile's match mode is ANY (any segment matches) or ALL (every segment must match).
Conditions you can match on
25 conditions are active. Each compares a value from the trip against a value you set, using one of the operators below.
| Condition | Type | Operators | What it matches |
|---|---|---|---|
| Distance Travelled | Decimal number | Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to | Matches on the live metered distance travelled so far (metered pricing only). |
| Estimate Trip Distance | Decimal number | Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to | Matches on the route distance estimated for the trip up front. |
| Speed | Decimal number | Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to | Matches on the live metered average speed (metered pricing only). |
| Accumulated Price | Decimal number | Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to | Matches on the live metered fare accumulated so far (metered pricing only). |
| Estimate Price | Decimal number | Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to | Matches on the price estimated for the trip up front. |
| Is Account Trip | Yes / No | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip is a corporate-account trip. |
| Specific Account | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip belongs to a specific account you choose. |
| Account Tag | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip's account carries a specific tag (lets one rule cover many accounts). |
| Specific Zone | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the pickup falls in a specific zone. |
| Specific Brand | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip is booked under a specific brand. |
| Trip Fleet | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip originates from a specific fleet. |
| Trip Fleet Operating Model | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip's fleet belongs to a specific fleet group. |
| Vehicle Type | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip uses a specific vehicle type. |
| Pickup Date (Schedule) | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the requested pickup time falls inside a recurring weekly schedule (evaluated in the operator's timezone, overnight windows supported). |
| Pickup Date (Specific) | Whole number | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the requested pickup time falls inside a specific calendar date range. |
| Calculation Date (Schedule) | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the current time falls inside a recurring weekly schedule. |
| Calculation Date (Specific) | Whole number | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the current time falls inside a specific calendar date range. |
| Transporter Fleet | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the driver/vehicle belongs to a specific fleet. |
| Entity | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Which type of record is being accessed (e.g. trips, customers). |
| Action | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the request is reading or writing. |
| Full Access | Yes / No | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Grants access to everything — an allow-all rule. |
| Time Restriction (Schedule) | Text | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Restricts access to a recurring weekly time window. |
| ASAP | Yes / No | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip is on-demand (ASAP) rather than pre-booked. |
| Pre-Booked | Yes / No | Equal to, Equal to (loose), Not equal to, Not equal to (loose) | Whether the trip is pre-booked rather than on-demand. |
| Customer Tier | Text | Equal to, Not equal to, Greater than or equal to, Less than or equal to | The customer's loyalty tier — operators let you say 'this tier or better' / 'or worse'. |
Defined but not yet active
These conditions appear in the engine but have no evaluator behind them yet — a rule using one will never match. Listed here for completeness; avoid relying on them.
Operators & value types
Operators
EQUALS— Equal toEQUALS_LOOSE— Equal to (loose)NOT_EQUALS— Not equal toNOT_EQUALS_LOOSE— Not equal to (loose)GREATER— Greater thanLESS— Less thanGREATER_OR_EQUALS— Greater than or equal toLESS_OR_EQUALS— Less than or equal to
Value types
INTEGER— Whole numberSTRING— TextFLOAT— Decimal numberBOOLEAN— Yes / No