Supporting Tool · Located in the EvoMass Tools tab

6. EvoMass Variable Adapter EvoMass变量适配器

EvoMass Variable Adapter editor and its four corresponding Grasshopper outputs
IMG-ADAPTER-01 — Four variable groups configured as Real, Integer, Even integer, and Boolean outputs. Each output contains the number of variables defined for that group. / 四个变量组分别配置为实数、整数、偶数整数和布尔值输出;每个输出包含该组中定义的变量数量。

The EvoMass Variable Adapter allows SSIEA to control variables in a custom Grasshopper parametric model. Because SSIEA does not directly control native Grasshopper sliders or Gene Pools, the Adapter supplies equivalent variable lists in the grouped structure required by EvoMass. The component is located in the EvoMass Tools tab; it is documented alongside the Generative Components because it extends the same sampling and optimization workflow to models that were not created with EvoMass's predefined massing components.

EvoMass Variable Adapter(EvoMass变量适配器)用于使SSIEA能够控制用户自定义Grasshopper参数化模型中的变量。由于SSIEA无法直接控制Grasshopper原生滑块或Gene Pool,变量适配器会按照EvoMass所需的分组结构提供等效的变量列表。该组件位于EvoMass的Tools(工具)选项卡中;由于它能够将同一采样与优化流程扩展至并非由EvoMass预设体量组件创建的模型,因此本手册将其与设计生成组件一并介绍。

6.1 Variable groups and outputs 变量组与输出

Double-click the component to open the EvoMass Variable Adapter editor. Each variable group creates one output on the Grasshopper component. The Variable group name becomes the output nickname, and Variables in this group determines the length of the output list. In the illustrated example, four groups create four outputs containing a total of ten generated variables.

双击组件可打开EvoMass Variable Adapter编辑器。每个变量组会在Grasshopper组件上创建一个输出端。Variable group name(变量组名称)将成为输出端的昵称,Variables in this group(组内变量数量)则决定输出列表的长度。图示示例中,四个变量组创建了四个输出,共包含十个生成变量。

Use Add variable group to create another output and the minus button beside a group to remove it. Removing a group that already has connected wires displays a warning because those wires will be disconnected when the change is applied. At least one group is always retained.

使用Add variable group(添加变量组)可创建新的输出端;单击变量组旁的减号按钮可将其移除。如果待移除的变量组已经连接导线,编辑器会发出警告,因为应用更改后这些导线将被断开。组件始终至少保留一个变量组。

6.2 Value types and domains 数值类型与取值域

All variables in one group share the same Value type and Shared value domain. Create separate groups whenever variables require different types, bounds, or real-number precision.

同一变量组中的所有变量共享相同的Value type(数值类型)和Shared value domain(共享取值域)。当变量需要不同的数值类型、上下限或实数精度时,应将其划分到不同变量组中。

Value type / 数值类型Generated values / 生成数值Domain behavior / 取值域规则
Real
实数
Decimal values / 小数值Uses the lower and upper bounds. Decimal places sets the output step from 0 to 6 decimal places, or uses full precision. / 使用上下限;Decimal places可设置0至6位小数或完整精度。
Integer
整数
Whole numbers / 整数值Bounds must be whole numbers and the domain must contain at least two valid values. / 上下限必须为整数,且取值域至少包含两个有效数值。
Odd integer
奇数整数
Odd whole numbers only / 仅生成奇数Only odd integers inside the specified bounds are generated. / 仅生成指定上下限内的奇数。
Even integer
偶数整数
Even whole numbers only / 仅生成偶数Only even integers inside the specified bounds are generated. / 仅生成指定上下限内的偶数。
Boolean
布尔值
False or TrueUses a fixed two-value domain; numeric bounds and decimal precision do not apply. / 使用固定的二值取值域,不需要数值上下限和小数精度。

For non-Boolean groups, enter a Lower bound and an Upper bound. The upper bound must be greater than the lower bound. The range preview summarizes the active domain and reports whether the selected integer or precision settings leave enough valid values.

对于非布尔变量组,需要输入Lower bound(下限)和Upper bound(上限),且上限必须大于下限。取值域预览会显示当前有效范围,并提示所选整数类型或精度设置是否包含足够的有效数值。

6.3 Editing and applying groups 编辑与应用变量组

Select a group in the left-hand list to edit it. A green check mark and the Valid status indicate that its current settings can be applied. Copy settings to all groups copies the selected group's value type, variable count, precision, and domain to the remaining groups while preserving their names. This is useful when several outputs require the same configuration.

在左侧列表中选择变量组即可进行编辑。绿色勾号和Valid(有效)状态表示当前设置可以应用。Copy settings to all groups(将设置复制到所有变量组)会将所选变量组的数值类型、变量数量、精度和取值域复制到其他变量组,同时保留各组名称。多个输出需要相同配置时,可使用该功能快速设置。

The editor stores changes as drafts until Apply changes is selected. Cancel closes the editor without applying the current draft. Reset all resets every existing group to one Real variable with a domain from 0 to 1; it does not change the number of groups.

在单击Apply changes(应用更改)之前,编辑器中的修改仅作为草稿保存。Cancel(取消)会关闭编辑器而不应用当前草稿。Reset all(全部重置)会将每个现有变量组重置为一个取值域为0至1的实数变量,但不会改变变量组数量。

Animation showing how to add, rename, and configure Variable Adapter groups
GIF-ADAPTER-EDIT-GROUPS-01 — Add a variable group, rename it, change its variable count and value settings, apply the changes, and show the corresponding Grasshopper output nickname and list structure updating. / 添加变量组并重命名,调整变量数量与取值设置,应用更改,并展示Grasshopper组件相应输出端的昵称与列表结构随之更新。

6.4 Connect and test a custom model 连接与测试自定义模型

Connect each Adapter output list to the corresponding part of the custom Grasshopper model. When individual values are required, use standard Grasshopper list-management components such as List Item to extract them. The custom definition should produce the geometry to be explored and the numerical results that will later be connected to SSIEA as fitness objectives or tracked values.

将适配器的各个输出列表连接至自定义Grasshopper模型中的相应部分。当模型需要单个数值时,可使用List Item等Grasshopper列表管理组件提取变量。该Grasshopper定义应生成待探索的设计几何,以及随后连接至SSIEA、用作优化目标或记录值的数值结果。

Before configuring SSIEA, right-click the Variable Adapter and choose Generate Sample Model. This replaces the current output values with another valid sample and lets you confirm that every output controls the intended model parameter. Check several samples for invalid geometry, failed calculations, or unsuitable domains before starting an optimization.

配置SSIEA之前,可右键单击变量适配器并选择Generate Sample Model(生成示例模型)。该命令会使用另一组有效样本替换当前输出值,便于确认每个输出是否控制了预期的模型参数。正式优化前,建议检查多个样本是否出现无效几何、计算失败或取值域不合理等问题。

6.5 Use the Adapter with SSIEA 与SSIEA配合使用

Drag a connection from the Generator(s) connector on SSIEA to the Variable Adapter so that SSIEA recognizes it as a controllable generator. Connect the custom model's numerical evaluation results to SSIEA separately. SSIEA can then assign normalized genes to the Adapter and convert them into the Real, Integer, Odd integer, Even integer, or Boolean values defined by each group.

从SSIEA的Generator(s)(生成组件)连接端拖动导线至变量适配器,使SSIEA将其识别为可控制的生成组件;自定义模型的数值评价结果则需要另行连接至SSIEA。随后,SSIEA可向适配器分配归一化基因值,并按照各变量组的设置将其转换为实数、整数、奇数整数、偶数整数或布尔值。

Use SSIEA's Generate Sample Model command to test the complete definition before optimization. This updates the Adapter variables and recalculates the connected custom model in one solution. For detailed objective assignment and optimization settings, continue to 7. Optimization Setup.

正式优化前,可使用SSIEA的Generate Sample Model(生成示例模型)命令测试完整定义。该命令会在同一次求解中更新适配器变量并重新计算已连接的自定义模型。有关目标设置和优化参数的详细说明,请继续阅读7. Optimization Setup(优化设置)。

Enlarged manual illustration