> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/document-processing/decision-trees/collect-sum-policy.md).

# Collect (sum) 策略

此策略会收集所有匹配的规则并对结果求和。此策略仅适用于 **Return Type Value**。

**示例：**

| 规则 | 条件                   | 返回值 |
| -- | -------------------- | --- |
| 1  | Total Amount <= 1000 | 1   |
| 2  | Total Amount <= 2000 | 2   |
| 3  | Total Amount <= 3000 | 3   |
| 4  | Total Amount <= 4000 | 4   |
| 5  | Total Amount <= 5000 | 5   |

对于输入值 **Total Amount = 2500**，规则的评估结果如下：

* **规则 1**：Total Amount <= 1000（不匹配）
* **规则 2**：Total Amount <= 2000（不匹配）
* **规则 3**：Total Amount <= 3000（匹配，返回值 = 3）
* **规则 4**：Total Amount <= 4000（匹配，返回值 = 4）
* **规则 5**：Total Amount <= 5000（匹配，返回值 = 5）

由于应用了 **Collect (sum)** 策略，我们将匹配规则的 **返回值** 相加，分别为 **3、4、5**。

**将这些值相加**：

* 5 + 4 + 3 = **12**

因此，决策树返回的结果为 **12**，即所有匹配规则的返回值之和。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/document-processing/decision-trees/collect-sum-policy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
