元编程参考文档

排列与匹配

4 个节点

本页内容 4

最大匹配

函数

As many pairs as can be made between a left set and a right set, each pair along an allowed edge and nothing used twice: workers to jobs, players to seats. The nth edge joins left[n] to right[n].

签名
最大匹配 -> (对数: 整数, 配对: 整数数组)
    左侧数量: 整数
    右侧数量: 整数
    边的左端: 整数数组
    边的右端: 整数数组
int MaximumMatching(
    int leftCount,
    int rightCount,
    int[] edgeLefts,
    int[] edgeRights,
    out int[] partners)

参数

名称类型默认值说明
左侧数量整数—How many on the left, numbered from 0.
右侧数量整数—How many on the right, numbered from 0.
边的左端整数数组—Each allowed edge's left end.
边的右端整数数组—Each allowed edge's right end.

返回

对数整数
配对整数数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
排列与匹配
所属包
罪案引擎

随机排列

函数

The numbers 0 to count - 1 in a random order.

签名
随机排列(数量: 整数, 种子: 整数) -> 整数数组
int[] Permutation(int count, int seed = 1)

参数

名称类型默认值说明
数量整数—How many.
种子整数1The same seed gives the same order.

返回

顺序整数数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
排列与匹配
所属包
罪案引擎

随机抽样

函数

Some of the numbers 0 to from - 1, none twice, in a random order.

签名
随机抽样(抽取数量: 整数, 总数: 整数, 种子: 整数) -> 整数数组
int[] Sample(int count, int from, int seed = 1)

参数

名称类型默认值说明
抽取数量整数—How many to take.
总数整数—How many there are to take from.
种子整数1The same seed gives the same sample.

返回

样本整数数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
排列与匹配
所属包
罪案引擎

打乱数字

函数

The numbers in a random order.

签名
打乱数字(数字: 整数数组, 种子: 整数) -> 整数数组
int[] Shuffle(int[] values, int seed = 1)

参数

名称类型默认值说明
数字整数数组—The numbers.
种子整数1The same seed gives the same order.

返回

打乱后整数数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
排列与匹配
所属包
罪案引擎