> For the complete documentation index, see [llms.txt](https://docs.fulfillmenttools.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fulfillmenttools.com/documentation/by-pillar/advanced-order-routing/complex-routing-with-combinatorics/ratings.md).

# Ratings

{% hint style="info" %}
If you would like to use these functionalities, [contact our Support team](https://ocfulfillment.atlassian.net/servicedesk/customer/portal/1) for more information and activation support.
{% endhint %}

Ratings quantify how well a candidate sourcing option meets routing objectives. Each rating produces a penalty value that is normalized and weighted. The routing engine aggregates penalties across ratings to compute a final score for each candidate.

## **Normalization**

* **Purpose**: Ensure comparability across ratings by mapping raw metric values to a normalized penalty range.
* **Parameters**: `minThreshold`, `maxThreshold`, `maxPenalty`.
* **Behavior:**
  * If the computed metric value of a routing option exactly equals `maxThreshold`, the rating assigns `maxPenalty`.
  * All ratings are uncapped: values above `maxThreshold` produce penalties greater than `maxPenalty`, increasing proportionally with the metric value.
  * Intermediate values are mapped proportionally between the thresholds.
  * This normalization ensures that metric differences translate into predictable and comparable penalty effects across all rating types.

## **Geo distance rating**

* **Definition**: Prefers options with shorter average distance from fulfillment locations to the final receiver.
* **Thresholds:**
  * `minThreshold` = 0 km
  * `maxThreshold` = 1000 km
* **Calculation**:
  * Consider only transfers that deliver to the final receiver.
  * Compute the average distance of those transfers.
  * Penalty = `(averageDistance / maxThreshold) × maxPenalty`.
* **Notes**: Number of items per transfer does not affect the distance calculation.

## **Assignment rate rating**

* **Definition**: Prefers options that assign a higher share of order lines within the candidate.
* **Thresholds:**
  * `minThreshold` = 0%
  * `maxThreshold` = 100%
* **Calculation**:
  * assignmentRate = `assignedItems / totalItems`.
  * Penalty = `(1 − assignmentRate) × maxPenalty`.
* **Notes**: This rating reflects order completeness and reduces partial fulfillment where possible.

## **Number of deliveries rating**

* **Definition**: Prefers options that minimize the number of partial deliveries to the final receiver.
* **Thresholds:**
  * `minThreshold` = 1 partial delivery
  * `maxThreshold` = 3 partial deliveries
* **Calculation**:
  * Count transfers that result in separate deliveries to the final receiver.
  * Map the count to a penalty using `minThreshold` and `maxThreshold`.
  * Penalty = `(1 − (number of partialDeliveries / maxThreshold) × maxPenalty)`.
* **Notes**: Fewer deliveries reduce customer complexity and operational overhead.

## **Binary toolkit rating**

* **Definition**: Applies binary conditions that must be met or penalized.
* **Thresholds:**
  * `minThreshold` = condition met
  * `maxThreshold` = condition not met
* **Examples**:
  * Facility tag matches order tag (for example, `SalesChannel: Amazon`).
  * Carrier capability present for a required service.
* **Calculation**: For each facility within the considered sourcing path that does not meet the condition, the defined penalty is applied once. If the condition is therefore not met by more than one location along the sourcing path, the defined penalty is applied multiple times to the sourcing path.

## **Total cost (cost component) rating**

* **Definition**: Evaluates the aggregated monetary cost of a sourcing option.
* **Thresholds:**
  * `minThreshold` = 0
  * `maxThreshold` = 50
* **Components**: purchase prices, shipping costs (optional components)
* **Calculation**:
  * `totalCost = sum(purchasePrices) + sum(shippingCosts)`.
  * Penalty = `(totalCost / maxThreshold) × maxPenalty`.
* **Notes**: All cost components must use the same currency. Missing or inconsistent cost data triggers a failure mode that applies the maximum penalty.

## **Delivery time rating**

* **Definition**: Evaluates the estimated delivery time for the final receiver to receive all partial shipments.
* **Thresholds:**
  * `minThreshold` = 0 days
  * `maxThreshold` = 10 days
* **Calculation**:
  * `deliveryTime = estimatedDeliveryDay - {today}`.
  * Penalty = `(deliveryTime / maxThreshold) × maxPenalty`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fulfillmenttools.com/documentation/by-pillar/advanced-order-routing/complex-routing-with-combinatorics/ratings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
