# Pywr 场景

Pywr 场景为水管理建模提供了一种更先进、更全面的方法，尤其是在处理不确定性以及评估数据和系统行为及数据输入的各种组合时。与侧重于本地调整的 WaterStrategy 场景不同，Pywr 场景允许您通过同时改变多个输入和组合来尝试各种可能性。

在 Pywr 场景中：

* 用户可以定义多个场景，每个场景包含多个变体（或大小）。
* 除非选择了特定的组合进行模拟，否则系统将模拟这些变体的所有组合。

例如，如果定义了两个 Pywr 场景，每个场景都有三个变体（大小 = 3），则模拟总数将为 9（3 x 3）。这种方法使用户能够探索模型中不同因素之间的各种潜在结果和相互作用。

## 1。激活 Pywr 场景

在网络中，单击 *查看网络数据* 图标 <img src="/files/6HsTgt8GKicrPS7Ncdkt" alt="" data-size="line">

这将打开右侧面板。在本节中 **输入**，键入”*场景”* 然后点击 *添加输入* 图标 <img src="/files/5BecbFNKJFJ6qRkYvZA6" alt="" data-size="line">

<figure><img src="/files/ZS9koYzHOxLNNC3Tmz53" alt=""><figcaption></figcaption></figure>

将显示一个窗口，键入”*场景”*，选择 **场景** 属性并单击 **保存** 如下图所示

<figure><img src="/files/uKSiiaZvoBGxtp1nQy0Q" alt=""><figcaption></figcaption></figure>

将弹出一个新窗口，选择 **PYWR\_场景** 然后点击 **保存**

<figure><img src="/files/Hk2yu5BgfOZXxR3UkFBV" alt=""><figcaption></figcaption></figure>

## 2。创建 pywr 场景

场景自定义面板打开后，您可以根据需要定义任意数量的 Pywr 场景。要创建新的 Pywr 场景，请执行以下步骤：

点击 <img src="/files/kwYYzBUegwjwB2HfShp7" alt="" data-size="line">

<figure><img src="/files/35GIMd9AALHDbdWTknrk" alt=""><figcaption></figcaption></figure>

点击编辑当前的默认场景 <img src="/files/BqLiLaqJ8TTD7XhGpMxw" alt="" data-size="line">

输入 **姓名** 对于 Pywr 场景并指定 **大小** （变体数量）。

这个 **合奏** 属性是可选的，有助于跟踪 Pywr 场景中的特定索引场景

<figure><img src="/files/wmmcKsXy3sL2rzAU240V" alt=""><figcaption></figcaption></figure>

创建 pywr-scenaion 后，系统将显示以下信息：

<figure><img src="/files/IulmHINflGA7pzRSFeuP" alt=""><figcaption></figcaption></figure>

点击 **JSON** 选项卡将显示的自动 JSON 版本 **Pywr-Scenario** 定义

<figure><img src="/files/xRZIsYJlxGsCBdPLhTbt" alt="" width="409"><figcaption></figcaption></figure>

要将数据加载为 h5 DataFrameParameter，请参阅 [HDF5 参数部分](/waterstrategy/zhong-guo-ren/jian-mo-ji-chu-zhi-shi/parameters/hdf5-parameter.md) 以便正确访问场景数据


---

# Agent Instructions: 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:

```
GET https://water-strategy.gitbook.io/waterstrategy/zhong-guo-ren/jian-mo-ji-chu-zhi-shi/scenarios/pywr-scenarios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
