> 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-min-max-count-policy.md).

# 收集（最小值/最大值/计数）策略

此策略会收集所有匹配的规则，然后选择 **最小值**、**最大值**或对匹配项进行**计数**。它仅适用于 **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   |

1. 如果选择 **Collect (min)** 选项，结果将返回匹配规则中 **Return Values** 的**最小值**。
   * 输入值为 **Total Amount = 2500** 时，规则的评估结果如下：
     * **规则 1**：Total Amount <= 1000（不匹配）
     * **规则 2**：Total Amount <= 2000（不匹配）
     * **规则 3**：Total Amount <= 3000（匹配，Return Value = 3）
     * **规则 4**：Total Amount <= 4000（匹配，Return Value = 4）
     * **规则 5**：Total Amount <= 5000（匹配，Return Value = 5）
   * **匹配的规则**为规则 3、规则 4 和规则 5，其 **Return Values** 分别为 **3、4 和 5**。
   * 由于应用了 **Collect (min)** 策略，结果将是**最小值**，即 **3**。
   * **结果**：**3**
2. 如果选择 **Collect (max)** 选项，结果将返回匹配规则中 **Return Values** 的**最大值**。
   * 对于上述相同的评估，结果如下：
   * **结果**：**5**
3. 如果选择 **Collect (count)** 选项，结果将对**匹配规则的数量**进行计数。
   * 对于上述相同的评估，结果如下：
   * **结果**：**3**（因为有 3 条规则匹配）。


---

# 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-min-max-count-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.
