Skip to main content

CreateRandomValueGenerator

汇总

CreateRandomValueGenerator 函数用于创建随机数生成器。

讨论

旧版本:

自 ArcGIS Pro 2.0 起不再支持 arcgis.rand()arcgis.rand() 函数主要用于支持通过 计算值计算字段 工具、 随机数生成器 环境设置以及 CreateRandomValueGenerator 函数创建随机值。应使用利用 Python random 模块的类似函数。

语法

CreateRandomValueGenerator(seed, distribution)

参数 说明 数据类型

seed

Initializes the random number generator.

Integer

distribution

Specifies the random generation algorithm that will be used.

  • ACM599—The ACM collected algorithm 599 will be used.

  • MERSENNE_TWISTER—The Mersenne Twister mt19937 algorithm will be used.

  • STANDARD_C—The Standard C Rand algorithm will be used.

(默认值为 ACM599)

String

返回值

数据类型 说明

Object

RandomNumberGenerator 对象。